mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-21 11:30:01 +00:00
Honor c->is_resp with Connection:close
This commit is contained in:
1 parent
9fc92e901e
commit
d37c300d87
2 files changed
+2
-2
No files matched your search
+1
-1
@@ -3310,7 +3310,7 @@ static void http_cb(struct mg_connection *c, int ev, void *ev_data) {
|
||||
|
||||
if (c->is_accepted) c->is_resp = 1; // Start generating response
|
||||
mg_call(c, MG_EV_HTTP_MSG, &hm); // User handler can clear is_resp
|
||||
if (c->is_accepted) {
|
||||
if (c->is_accepted && !c->is_resp) {
|
||||
struct mg_str *cc = mg_http_get_header(&hm, "Connection");
|
||||
if (cc != NULL && mg_strcasecmp(*cc, mg_str("close")) == 0) {
|
||||
c->is_draining = 1; // honor "Connection: close"
|
||||
|
||||
+1
-1
@@ -1094,7 +1094,7 @@ static void http_cb(struct mg_connection *c, int ev, void *ev_data) {
|
||||
|
||||
if (c->is_accepted) c->is_resp = 1; // Start generating response
|
||||
mg_call(c, MG_EV_HTTP_MSG, &hm); // User handler can clear is_resp
|
||||
if (c->is_accepted) {
|
||||
if (c->is_accepted && !c->is_resp) {
|
||||
struct mg_str *cc = mg_http_get_header(&hm, "Connection");
|
||||
if (cc != NULL && mg_strcasecmp(*cc, mg_str("close")) == 0) {
|
||||
c->is_draining = 1; // honor "Connection: close"
|
||||
|
||||
Reference in new issue
Block a user