Skip to content

Commit

Permalink
On new connection, clear off receiving buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
cpq committed Dec 5, 2012
1 parent 0263e39 commit 0b09df9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mongoose.c
Expand Up @@ -4637,6 +4637,9 @@ static void process_new_connection(struct mg_connection *conn) {

keep_alive_enabled = !strcmp(conn->ctx->config[ENABLE_KEEP_ALIVE], "yes");

// Important: on new connection, reset the receiving buffer. Credit goes
// to crule42.
conn->data_len = 0;
do {
reset_per_request_attributes(conn);
conn->request_len = read_request(NULL, conn, conn->buf, conn->buf_size,
Expand Down

0 comments on commit 0b09df9

Please sign in to comment.