From: Fabian Keil <fk@fabiankeil.de>
Date: Tue, 25 Feb 2020 16:54:34 +0000 (+0100)
Subject: get_url_actions(): Don't initialize actions when called the second time
X-Git-Tag: v_3_0_29~483
X-Git-Url: http://www.privoxy.org/gitweb/%22https:/developer-manual/faq/@default-cgi@edit-actions-list?a=commitdiff_plain;h=33f7c19c89a73da5e7e195c6f5185b09f7d59b9f;p=privoxy.git

get_url_actions(): Don't initialize actions when called the second time

Sponsored by: Robert Klemme
---

diff --git a/filters.c b/filters.c
index 0d36485d..d29d422f 100644
--- a/filters.c
+++ b/filters.c
@@ -2300,7 +2300,20 @@ void get_url_actions(struct client_state *csp, struct http_request *http)
    struct url_actions *b;
    int i;
 
-   init_current_action(csp->action);
+#ifdef FEATURE_HTTPS_FILTERING
+   if (!csp->http->client_ssl)
+#endif
+   {
+      /*
+       * When filtering TLS traffic this function gets called a
+       * second time after the encrypted headers have been received.
+       *
+       * Only initialize the first time. The second time we apply
+       * the newly set actions on top of the ones that were set
+       * the first time.
+       */
+      init_current_action(csp->action);
+   }
 
    for (i = 0; i < MAX_AF_FILES; i++)
    {