Rename the mutex used to protect the block reason statistics
[privoxy.git] / filters.c
index c49f1bc..48259a8 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)
@@ -2192,7 +2180,9 @@ static jb_err remove_chunked_transfer_coding(char *buffer, size_t *size)
        */
       if (NULL == (from_p = strstr(from_p, "\r\n")))
       {
-         log_error(LOG_LEVEL_ERROR, "Parse error while stripping \"chunked\" transfer coding");
+         log_error(LOG_LEVEL_ERROR,
+            "Failed to strip \"chunked\" transfer coding. "
+            "Line with chunk size doesn't seem to end properly.");
          return JB_ERR_PARSE;
       }
       from_p += 2;
@@ -2207,7 +2197,8 @@ static jb_err remove_chunked_transfer_coding(char *buffer, size_t *size)
       if (from_p + chunksize >= end_of_buffer)
       {
          log_error(LOG_LEVEL_ERROR,
-            "End of chunk is beyond the end of the buffer.");
+            "Failed to decode content for filtering. "
+            "One chunk end is beyond the end of the buffer.");
          return JB_ERR_PARSE;
       }
 
@@ -3094,14 +3085,14 @@ void register_block_reason_for_statistics(const char *block_reason)
 {
    struct block_statistics_entry *entry;
 
-   privoxy_mutex_lock(&block_statistics_mutex);
+   privoxy_mutex_lock(&block_reason_statistics_mutex);
 
    if (block_statistics == NULL)
    {
       block_statistics = zalloc_or_die(sizeof(struct block_statistics_entry));
       entry = block_statistics;
       entry->block_reason = strdup_or_die(block_reason);
-      privoxy_mutex_unlock(&block_statistics_mutex);
+      privoxy_mutex_unlock(&block_reason_statistics_mutex);
       return;
    }
    entry = block_statistics;
@@ -3121,7 +3112,7 @@ void register_block_reason_for_statistics(const char *block_reason)
       entry = entry->next;
    }
 
-   privoxy_mutex_unlock(&block_statistics_mutex);
+   privoxy_mutex_unlock(&block_reason_statistics_mutex);
 
 }
 
@@ -3142,7 +3133,7 @@ static void increment_block_reason_counter(const char *block_reason)
 {
    struct block_statistics_entry *entry;
 
-   privoxy_mutex_lock(&block_statistics_mutex);
+   privoxy_mutex_lock(&block_reason_statistics_mutex);
 
    entry = block_statistics;
    while (entry != NULL)
@@ -3155,7 +3146,7 @@ static void increment_block_reason_counter(const char *block_reason)
       entry = entry->next;
    }
 
-   privoxy_mutex_unlock(&block_statistics_mutex);
+   privoxy_mutex_unlock(&block_reason_statistics_mutex);
 
 }
 
@@ -3178,7 +3169,7 @@ void get_block_reason_count(const char *block_reason, unsigned long long *count)
 {
    struct block_statistics_entry *entry;
 
-   privoxy_mutex_lock(&block_statistics_mutex);
+   privoxy_mutex_lock(&block_reason_statistics_mutex);
 
    entry = block_statistics;
    while (entry != NULL)
@@ -3191,7 +3182,7 @@ void get_block_reason_count(const char *block_reason, unsigned long long *count)
       entry = entry->next;
    }
 
-   privoxy_mutex_unlock(&block_statistics_mutex);
+   privoxy_mutex_unlock(&block_reason_statistics_mutex);
 
 }