Make pthread mutex locking more generic. Instead of
[privoxy.git] / cgi.c
diff --git a/cgi.c b/cgi.c
index dd32595..da9d087 100644 (file)
--- a/cgi.c
+++ b/cgi.c
@@ -1,4 +1,4 @@
-const char cgi_rcs[] = "$Id: cgi.c,v 1.77 2006/09/21 15:17:23 fabiankeil Exp $";
+const char cgi_rcs[] = "$Id: cgi.c,v 1.78 2006/09/21 19:22:07 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/cgi.c,v $
@@ -38,6 +38,11 @@ const char cgi_rcs[] = "$Id: cgi.c,v 1.77 2006/09/21 15:17:23 fabiankeil Exp $";
  *
  * Revisions   :
  *    $Log: cgi.c,v $
+ *    Revision 1.78  2006/09/21 19:22:07  fabiankeil
+ *    Use CGI_PREFIX to check the referrer.
+ *    The check for "http://config.privoxy.org/" fails
+ *    if the user modified CGI_SITE_2_HOST.
+ *
  *    Revision 1.77  2006/09/21 15:17:23  fabiankeil
  *    Adjusted headers for Privoxy's cgi responses:
  *    Don't set Last-Modified, Expires and Cache-Control
@@ -513,7 +518,6 @@ const char cgi_rcs[] = "$Id: cgi.c,v 1.77 2006/09/21 15:17:23 fabiankeil Exp $";
 #include "loadcfg.h"
 /* loadcfg.h is for global_toggle_state only */
 #ifdef FEATURE_PTHREAD
-#include <pthread.h>
 #include "jcc.h"
 /* jcc.h is for mutex semaphore globals only */
 #endif /* def FEATURE_PTHREAD */
@@ -1688,7 +1692,7 @@ void get_http_time(int time_offset, char *buf)
 
    struct tm *t;
    time_t current_time;
-#if defined(HAVE_GMTIME_R) && !defined(OSX_DARWIN)
+#if defined(HAVE_GMTIME_R)
    /*
     * Declare dummy up here (instead of inside get/set gmt block) so it
     * doesn't go out of scope before it's potentially used in snprintf later.
@@ -1706,12 +1710,12 @@ void get_http_time(int time_offset, char *buf)
 
    /* get and save the gmt */
    {
-#ifdef OSX_DARWIN
+#if HAVE_GMTIME_R
+      t = gmtime_r(&current_time, &dummy);
+#elif FEATURE_PTHREAD
       pthread_mutex_lock(&gmtime_mutex);
       t = gmtime(&current_time);
       pthread_mutex_unlock(&gmtime_mutex);
-#elif HAVE_GMTIME_R
-      t = gmtime_r(&current_time, &dummy);
 #else
       t = gmtime(&current_time);
 #endif