Log complete https request lines with LOG_LEVEL_CLF
authorFabian Keil <fk@fabiankeil.de>
Wed, 13 May 2020 09:53:12 +0000 (11:53 +0200)
committerFabian Keil <fk@fabiankeil.de>
Sat, 16 May 2020 09:10:49 +0000 (11:10 +0200)
... at the end of handle_established_connection().

Sponsored by: Robert Klemme

jcc.c

diff --git a/jcc.c b/jcc.c
index feab1ac..7232e7d 100644 (file)
--- a/jcc.c
+++ b/jcc.c
@@ -3440,9 +3440,19 @@ static void handle_established_connection(struct client_state *csp)
    }
 #endif
 
-   log_error(LOG_LEVEL_CLF, "%s - - [%T] \"%s\" 200 %llu",
-      csp->ip_addr_str, http->ocmd, csp->content_length);
-
+#ifdef FEATURE_HTTPS_INSPECTION
+   if (client_use_ssl(csp))
+   {
+      log_error(LOG_LEVEL_CLF, "%s - - [%T] \"%s https://%s%s %s\" 200 %llu",
+         csp->ip_addr_str, http->gpc, http->hostport, http->path,
+         http->ver, csp->content_length);
+   }
+   else
+#endif
+   {
+      log_error(LOG_LEVEL_CLF, "%s - - [%T] \"%s\" 200 %llu",
+         csp->ip_addr_str, http->ocmd, csp->content_length);
+   }
    csp->server_connection.timestamp = time(NULL);
 }