process_encrypted_request(): Improve error message
authorFabian Keil <fk@fabiankeil.de>
Thu, 7 Jan 2021 13:48:10 +0000 (14:48 +0100)
committerFabian Keil <fk@fabiankeil.de>
Sun, 10 Jan 2021 15:48:22 +0000 (16:48 +0100)
... emitted when the rewritten request line is invalid.

While at it, emit a LOG_LEVEL_CLF message.

jcc.c

diff --git a/jcc.c b/jcc.c
index c824d94..75459e8 100644 (file)
--- a/jcc.c
+++ b/jcc.c
@@ -2812,11 +2812,15 @@ static jb_err process_encrypted_request(struct client_state *csp)
       || (strcmp(csp->http->cmd, csp->https_headers->first->str) &&
          (JB_ERR_OK != change_encrypted_request_destination(csp))))
    {
-      log_error(LOG_LEVEL_ERROR,
-         "Failed to get the request destination in the rewritten headers");
       ssl_send_data_delayed(&(csp->ssl_client_attr),
          (const unsigned char *)MESSED_UP_REQUEST_RESPONSE,
          strlen(MESSED_UP_REQUEST_RESPONSE), get_write_delay(csp));
+      log_error(LOG_LEVEL_ERROR,
+         "Invalid request line after applying header filters.");
+      /* XXX: Use correct size */
+      log_error(LOG_LEVEL_CLF,
+         "%s - - [%T] \"Invalid request generated\" 400 0", csp->ip_addr_str);
+
       return JB_ERR_PARSE;
    }