Skip to content

Commit 43d7463

Browse files
author
Vasyl Vavrychuk
committed
fixed keep alive in mongoose still being problematic
Parenthesis issue :((( Addition to 4f8ac4e
1 parent 97e8a08 commit 43d7463

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/third_party/mongoose/mongoose.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -786,9 +786,12 @@ static int match_extension(const char *path, const char *ext_list) {
786786
static int should_keep_alive(const struct mg_connection *conn) {
787787
const char *http_version = conn->request_info.http_version;
788788
const char *header = mg_get_header(conn, "Connection");
789-
return (!mg_strcasecmp(conn->ctx->config[ENABLE_KEEP_ALIVE], "yes") &&
790-
(header == NULL && http_version && !strcmp(http_version, "1.1"))) ||
791-
(header != NULL && !mg_strcasecmp(header, "keep-alive"));
789+
790+
if (mg_strcasecmp(conn->ctx->config[ENABLE_KEEP_ALIVE], "yes") != 0)
791+
return 0;
792+
793+
return (header == NULL && http_version && !strcmp(http_version, "1.1")) ||
794+
(header != NULL && !mg_strcasecmp(header, "keep-alive"));
792795
}
793796

794797
static const char *suggest_connection_header(const struct mg_connection *conn) {

0 commit comments

Comments
 (0)