Don't disable redirect checkers in redirect_url()
authorFabian Keil <fk@fabiankeil.de>
Fri, 26 Feb 2021 08:27:57 +0000 (09:27 +0100)
committerFabian Keil <fk@fabiankeil.de>
Fri, 12 Mar 2021 11:34:11 +0000 (12:34 +0100)
Disable them in handle_established_connection() instead.

Doing it in redirect_url() prevented the +redirect{} and
+fast-redirects{} actions from being logged with LOG_LEVEL_ACTIONS.

filters.c
jcc.c

index c49f1bc..ab20038 100644 (file)
--- a/filters.c
+++ b/filters.c
@@ -1277,19 +1277,7 @@ struct http_response *redirect_url(struct client_state *csp)
       new_url = get_last_url(old_url, redirect_mode);
       freez(old_url);
    }
-
-   /*
-    * Disable redirect checkers, so that they
-    * will be only run more than once if the user
-    * also enables them through tags.
-    *
-    * From a performance point of view
-    * it doesn't matter, but the duplicated
-    * log messages are annoying.
-    */
-   csp->action->flags &= ~ACTION_FAST_REDIRECTS;
 #endif /* def FEATURE_FAST_REDIRECTS */
-   csp->action->flags &= ~ACTION_REDIRECT;
 
    /* Did any redirect action trigger? */
    if (new_url)
diff --git a/jcc.c b/jcc.c
index 12e7736..58af472 100644 (file)
--- a/jcc.c
+++ b/jcc.c
@@ -3864,6 +3864,18 @@ static void handle_established_connection(struct client_state *csp)
                return;
             }
 
+            /*
+             * Disable redirect checkers, so that they will be only run
+             * again if the user also enables them through tags.
+             *
+             * From a performance point of view it doesn't matter,
+             * but it prevents duplicated log messages.
+             */
+#ifdef FEATURE_FAST_REDIRECTS
+            csp->action->flags &= ~ACTION_FAST_REDIRECTS;
+#endif
+            csp->action->flags &= ~ACTION_REDIRECT;
+
             /*
              * We have now received the entire server header,
              * filter it and send the result to the client