mirror of
https://github.com/cesanta/mongoose.git
synced 2024-12-28 23:49:44 +08:00
Closing connection on 5xx errors
This commit is contained in:
parent
bba29d32ce
commit
88cf329490
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user