1
0
mirror of https://github.com/lammertb/libhttp.git synced 2025-08-09 03:22:45 +03:00

Fixed potential dead-lock in connection_close()

This was posted by Morgan McGuire.
This commit is contained in:
Thomas Davis
2013-09-23 21:46:41 -04:00
parent b76325205c
commit 55c27d4751

View File

@@ -5326,12 +5326,12 @@ static void close_socket_gracefully(struct mg_connection *conn)
static void close_connection(struct mg_connection *conn)
{
mg_lock(conn);
// call the connection_close callback if assigned
if (conn->ctx->callbacks.connection_close != NULL)
conn->ctx->callbacks.connection_close(conn);
mg_lock(conn);
conn->must_close = 1;
#ifndef NO_SSL