Commit d665d9e9 authored by Deomid Ryabkov's avatar Deomid Ryabkov Committed by rojer

Always Be Closing

    PUBLISHED_FROM=29ca7cdd9024790bd75892f9f67b3f83a6bd00d1
parent a5e10450
......@@ -1905,9 +1905,7 @@ static void mg_destroy_conn(struct mg_connection *conn) {
void mg_close_conn(struct mg_connection *conn) {
DBG(("%p %lu", conn, conn->flags));
if (!(conn->flags & MG_F_CONNECTING)) {
mg_call(conn, NULL, MG_EV_CLOSE, NULL);
}
mg_call(conn, NULL, MG_EV_CLOSE, NULL);
mg_remove_conn(conn);
mg_destroy_conn(conn);
}
......@@ -2550,6 +2548,7 @@ static void resolve_cb(struct mg_dns_message *msg, void *data) {
* If we get there was no MG_DNS_A_RECORD in the answer
*/
mg_call(nc, NULL, MG_EV_CONNECT, &failure);
mg_call(nc, NULL, MG_EV_CLOSE, NULL);
mg_destroy_conn(nc);
}
#endif
......
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