Only use certificate_mutex and rng_mutex when needed
authorFabian Keil <fk@fabiankeil.de>
Wed, 26 Feb 2020 09:07:05 +0000 (10:07 +0100)
committerFabian Keil <fk@fabiankeil.de>
Fri, 28 Feb 2020 06:31:27 +0000 (07:31 +0100)
Previously they were defined and initialized unconditionally.

Sponsored by: Robert Klemme

jcc.c
jcc.h

diff --git a/jcc.c b/jcc.c
index 3129bab..a3f92ec 100644 (file)
--- a/jcc.c
+++ b/jcc.c
@@ -193,8 +193,10 @@ privoxy_mutex_t log_mutex;
 privoxy_mutex_t log_init_mutex;
 privoxy_mutex_t connection_reuse_mutex;
 
+#ifdef FEATURE_HTTPS_INSPECTION
 privoxy_mutex_t certificate_mutex;
 privoxy_mutex_t rng_mutex;
+#endif
 
 #ifdef FEATURE_EXTERNAL_FILTERS
 privoxy_mutex_t external_filter_mutex;
@@ -4586,8 +4588,10 @@ static void initialize_mutexes(void)
     * Prepare global mutex semaphores
     */
 
+#ifdef FEATURE_HTTPS_INSPECTION
    privoxy_mutex_init(&certificate_mutex);
    privoxy_mutex_init(&rng_mutex);
+#endif
 
    privoxy_mutex_init(&log_mutex);
    privoxy_mutex_init(&log_init_mutex);
diff --git a/jcc.h b/jcc.h
index 345658a..8458aa1 100644 (file)
--- a/jcc.h
+++ b/jcc.h
@@ -102,8 +102,10 @@ extern privoxy_mutex_t resolver_mutex;
 extern privoxy_mutex_t rand_mutex;
 #endif /* ndef HAVE_RANDOM */
 
+#ifdef FEATURE_HTTPS_INSPECTION
 extern privoxy_mutex_t certificate_mutex;
 extern privoxy_mutex_t rng_mutex;
+#endif
 
 #endif /* FEATURE_PTHREAD */