Log the "Request:" message for unencrypted requests later
authorFabian Keil <fk@fabiankeil.de>
Sun, 7 Jun 2020 07:53:36 +0000 (09:53 +0200)
committerFabian Keil <fk@fabiankeil.de>
Sun, 7 Jun 2020 09:27:12 +0000 (11:27 +0200)
In b94bbe62a I moved the block in front of the setting
of csp->http->client_ssl which meant the message was emitted
for encrypted requests as well.

This resulted in two "Request:" message instead of one.

Sponsored by: Robert Klemme

jcc.c

diff --git a/jcc.c b/jcc.c
index 0654f80..37472c8 100644 (file)
--- a/jcc.c
+++ b/jcc.c
@@ -3553,17 +3553,6 @@ static void chat(struct client_state *csp)
    {
       return;
    }
    {
       return;
    }
-#ifdef FEATURE_HTTPS_INSPECTION
-   /*
-    * Log the request unless we're https inspecting
-    * in which case we don't have the path yet and
-    * will log the request later.
-    */
-   if (!client_use_ssl(csp))
-#endif
-   {
-      log_error(LOG_LEVEL_REQUEST, "%s%s", http->hostport, http->path);
-   }
 
    /* decide how to route the HTTP request */
    fwd = forward_url(csp, http);
 
    /* decide how to route the HTTP request */
    fwd = forward_url(csp, http);
@@ -3648,6 +3637,18 @@ static void chat(struct client_state *csp)
    }
 #endif
 
    }
 #endif
 
+#ifdef FEATURE_HTTPS_INSPECTION
+   /*
+    * Log the request unless we're https inspecting
+    * in which case we don't have the path yet and
+    * will log the request later.
+    */
+   if (!client_use_ssl(csp))
+#endif
+   {
+      log_error(LOG_LEVEL_REQUEST, "%s%s", http->hostport, http->path);
+   }
+
    if (http->ssl && connect_port_is_forbidden(csp))
    {
       const char *acceptable_connect_ports =
    if (http->ssl && connect_port_is_forbidden(csp))
    {
       const char *acceptable_connect_ports =