From: Fabian Keil <fk@fabiankeil.de>
Date: Fri, 26 Feb 2021 08:27:57 +0000 (+0100)
Subject: Don't disable redirect checkers in redirect_url()
X-Git-Tag: v_3_0_33~106^2~10
X-Git-Url: http://www.privoxy.org/gitweb/@default-cgi@/faq/man-page/static/@proxy-info-url@?a=commitdiff_plain;h=908b065d8bcb6cb48969f1911b11cae0355236f1;p=privoxy.git

Don't disable redirect checkers in redirect_url()

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.
---

diff --git a/filters.c b/filters.c
index c49f1bc7..ab200384 100644
--- 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 12e77364..58af472e 100644
--- 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