浏览代码

Implement connection_close() callback.

William Greathouse 11 年之前
父节点
当前提交
6f862f01bf
共有 1 个文件被更改,包括 5 次插入0 次删除
  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)
 {
     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;
 
 #ifndef NO_SSL