From 346179d1f1e08451c8c3fb5e94b240686bf2f087 Mon Sep 17 00:00:00 2001 From: Sergey Lyubka Date: Tue, 14 Jan 2014 00:44:27 +0000 Subject: [PATCH] keep-alive for all EP_USER requests --- mongoose.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mongoose.c b/mongoose.c index dd74e782..f8de146f 100644 --- a/mongoose.c +++ b/mongoose.c @@ -1557,7 +1557,8 @@ static int should_keep_alive(const struct mg_connection *conn) { const char *method = conn->request_method; const char *http_version = conn->http_version; 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 && http_version && !strcmp(http_version, "1.1"))); }