Commit ac538f75 authored by Dmitry Frank's avatar Dmitry Frank Committed by Cesanta Bot

Close undrained and stuck http connections

CL: - Mongoose Web Server: close undrained and stuck http connections

PUBLISHED_FROM=a11656b195dbe2ef8473455a171a583e37cedb2c
parent 5b2eb4f0
......@@ -6435,6 +6435,13 @@ void mg_http_handler(struct mg_connection *nc, int ev,
else if (hm->message.len > pd->rcvd) {
/* Not yet received all HTTP body, deliver MG_EV_HTTP_CHUNK */
deliver_chunk(nc, hm, req_len);
if (nc->recv_mbuf_limit > 0 && nc->recv_mbuf.len >= nc->recv_mbuf_limit) {
LOG(LL_ERROR, ("%p recv buffer (%lu bytes) exceeds the limit "
"%lu bytes, and not drained, closing",
nc, (unsigned long) nc->recv_mbuf.len,
(unsigned long) nc->recv_mbuf_limit));
nc->flags |= MG_F_CLOSE_IMMEDIATELY;
}
} else {
/* We did receive all HTTP body. */
int trigger_ev = nc->listener ? MG_EV_HTTP_REQUEST : MG_EV_HTTP_REPLY;
......
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