From 908b065d8bcb6cb48969f1911b11cae0355236f1 Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Fri, 26 Feb 2021 09:27:57 +0100 Subject: [PATCH] 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. --- filters.c | 12 ------------ jcc.c | 12 ++++++++++++ 2 files changed, 12 insertions(+), 12 deletions(-) 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 -- 2.39.2