Forcing connection close when client disconnects.

This commit is contained in:
Sergey Lyubka 2013-03-08 07:03:23 +00:00
parent 62085e5215
commit 36b7c8d60d

View File

@ -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);