浏览代码

Correct and comment log_access (test the correct callback)

bel 9 年之前
父节点
当前提交
a71d31cf2f
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      src/civetweb.c

+ 3 - 1
src/civetweb.c

@@ -10978,7 +10978,9 @@ log_access(const struct mg_connection *conn)
 		fi.fp = NULL;
 	}
 
-	if (fi.fp == NULL && conn->ctx->callbacks.log_message == NULL) {
+	/* Log is written to a file and/or a callback. If both are not set,
+	 * executing the rest of the function is pointless. */
+	if ((fi.fp == NULL) && (conn->ctx->callbacks.log_access == NULL)) {
 		return;
 	}