Commit 6f66d794 authored by Sergey Lyubka's avatar Sergey Lyubka

Refactor NS_POLL case in mg_ev_handler

parent 1389eec7
...@@ -4945,15 +4945,17 @@ static void mg_ev_handler(struct ns_connection *nc, enum ns_event ev, void *p) { ...@@ -4945,15 +4945,17 @@ static void mg_ev_handler(struct ns_connection *nc, enum ns_event ev, void *p) {
break; break;
case NS_POLL: case NS_POLL:
if (call_user(conn, MG_POLL) == MG_TRUE) { if (conn != NULL) {
if (conn->ns_conn->flags & MG_HEADERS_SENT) { if (call_user(conn, MG_POLL) == MG_TRUE) {
write_terminating_chunk(conn); if (conn->ns_conn->flags & MG_HEADERS_SENT) {
write_terminating_chunk(conn);
}
close_local_endpoint(conn);
} }
close_local_endpoint(conn);
}
if (conn != NULL && conn->endpoint_type == EP_FILE) { if (conn->endpoint_type == EP_FILE) {
transfer_file_data(conn); transfer_file_data(conn);
}
} }
// Expire idle connections // Expire idle connections
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment