Commit 36b7c8d6 authored by Sergey Lyubka's avatar Sergey Lyubka

Forcing connection close when client disconnects.

parent 62085e52
...@@ -4905,6 +4905,7 @@ static int getreq(struct mg_connection *conn, char *ebuf, size_t ebuf_len) { ...@@ -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"); snprintf(ebuf, ebuf_len, "%s", "Request Too Large");
} if (conn->request_len <= 0) { } if (conn->request_len <= 0) {
snprintf(ebuf, ebuf_len, "%s", "Client closed connection"); snprintf(ebuf, ebuf_len, "%s", "Client closed connection");
conn->must_close = 1;
} else if (parse_http_message(conn->buf, conn->buf_size, } else if (parse_http_message(conn->buf, conn->buf_size,
&conn->request_info) <= 0) { &conn->request_info) <= 0) {
snprintf(ebuf, ebuf_len, "Bad request: [%.*s]", conn->data_len, conn->buf); snprintf(ebuf, ebuf_len, "Bad request: [%.*s]", conn->data_len, conn->buf);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment