mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-21 19:51:50 +00:00
keep-alive for all EP_USER requests
This commit is contained in:
1 parent
0148bc804a
commit
346179d1f1
1 file changed
+2
-1
+2
-1
@@ -1557,7 +1557,8 @@ static int should_keep_alive(const struct mg_connection *conn) {
|
|||||||
const char *method = conn->request_method;
|
const char *method = conn->request_method;
|
||||||
const char *http_version = conn->http_version;
|
const char *http_version = conn->http_version;
|
||||||
const char *header = mg_get_header(conn, "Connection");
|
const char *header = mg_get_header(conn, "Connection");
|
||||||
return method != NULL && !strcmp(method, "GET") &&
|
return method != NULL && (!strcmp(method, "GET") ||
|
||||||
|
((struct connection *) conn)->endpoint_type == EP_USER) &&
|
||||||
((header != NULL && !mg_strcasecmp(header, "keep-alive")) ||
|
((header != NULL && !mg_strcasecmp(header, "keep-alive")) ||
|
||||||
(header == NULL && http_version && !strcmp(http_version, "1.1")));
|
(header == NULL && http_version && !strcmp(http_version, "1.1")));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user