Browse Source

Implement connection_close() callback.

William Greathouse 11 years ago
parent
commit
6f862f01bf
1 changed files with 5 additions and 0 deletions
  1. 5 0
      src/civetweb.c

+ 5 - 0
src/civetweb.c

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