Browse Source

Correct and comment log_access (test the correct callback)

bel 9 years ago
parent
commit
a71d31cf2f
1 changed files with 3 additions and 1 deletions
  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;
 	}