Closing connection on 5xx errors

This commit is contained in:
Sergey Lyubka
2013-12-05 10:47:03 +00:00
parent bba29d32ce
commit 88cf329490
2 changed files with 8 additions and 0 deletions
+4
View File
@@ -145,6 +145,10 @@ static void send_http_error(struct mg_connection *conn, int status,
suggest_connection_header(conn));
conn->num_bytes_sent += mg_printf(conn, "%s", buf);
}
if (status >= 500) {
conn->must_close = 1;
}
}
// Return 1 if real file has been found, 0 otherwise
+4
View File
@@ -4016,6 +4016,10 @@ static void send_http_error(struct mg_connection *conn, int status,
suggest_connection_header(conn));
conn->num_bytes_sent += mg_printf(conn, "%s", buf);
}
if (status >= 500) {
conn->must_close = 1;
}
}
// Return 1 if real file has been found, 0 otherwise