Close if drained

This commit is contained in:
Sergey Lyubka committed 2025-05-03 10:28:40 +01:00
1 parent f618fe125c
commit 041ec6e1f8
2 files changed
+2

No files matched your search

+1
View File
@@ -5361,6 +5361,7 @@ void mg_mgr_poll(struct mg_mgr *mgr, int ms) {
if (s->twclosure &&
(!c->is_tls || (c->rtls.len == 0 && mg_tls_pending(c) == 0)))
c->is_closing = 1;
if (c->is_draining && c->send.len == 0) c->is_closing = 1;
if (c->is_closing) close_conn(c);
}
(void) ms;
+1
View File
@@ -1199,6 +1199,7 @@ void mg_mgr_poll(struct mg_mgr *mgr, int ms) {
if (s->twclosure &&
(!c->is_tls || (c->rtls.len == 0 && mg_tls_pending(c) == 0)))
c->is_closing = 1;
if (c->is_draining && c->send.len == 0) c->is_closing = 1;
if (c->is_closing) close_conn(c);
}
(void) ms;