File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -786,8 +786,9 @@ static int match_extension(const char *path, const char *ext_list) {
786786static 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 (header == NULL && http_version && !strcmp (http_version , "1.1" )) ||
790- (header != NULL && !mg_strcasecmp (header , "keep-alive" ));
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" ));
791792}
792793
793794static const char * suggest_connection_header (const struct mg_connection * conn ) {
You can’t perform that action at this time.
0 commit comments