소스 검색

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;
 	}