get_url_actions(): Don't initialize actions when called the second time
authorFabian Keil <fk@fabiankeil.de>
Tue, 25 Feb 2020 16:54:34 +0000 (17:54 +0100)
committerFabian Keil <fk@fabiankeil.de>
Wed, 26 Feb 2020 07:28:08 +0000 (08:28 +0100)
Sponsored by: Robert Klemme

filters.c

index 0d36485..d29d422 100644 (file)
--- 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++)
    {