Browse Source

Forcing connection close when client disconnects.

Sergey Lyubka 12 years ago
parent
commit
36b7c8d60d
1 changed files with 1 additions and 0 deletions
  1. 1 0
      mongoose.c

+ 1 - 0
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);