Explorar el Código

Correct and comment log_access (test the correct callback)

bel hace 9 años
padre
commit
a71d31cf2f
Se han modificado 1 ficheros con 3 adiciones y 1 borrados
  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;
 	}