From 36b7c8d60d3c8ba67cfb566db39147f07d935af1 Mon Sep 17 00:00:00 2001 From: Sergey Lyubka Date: Fri, 8 Mar 2013 07:03:23 +0000 Subject: [PATCH] Forcing connection close when client disconnects. --- mongoose.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mongoose.c b/mongoose.c index 732695ed..bd457fe2 100644 --- a/mongoose.c +++ b/mongoose.c @@ -4905,6 +4905,7 @@ static int getreq(struct mg_connection *conn, char *ebuf, size_t ebuf_len) { snprintf(ebuf, ebuf_len, "%s", "Request Too Large"); } if (conn->request_len <= 0) { snprintf(ebuf, ebuf_len, "%s", "Client closed connection"); + conn->must_close = 1; } else if (parse_http_message(conn->buf, conn->buf_size, &conn->request_info) <= 0) { snprintf(ebuf, ebuf_len, "Bad request: [%.*s]", conn->data_len, conn->buf);