-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 $
*
* 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
#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 */
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.
/* get and save the gmt */
{
-#ifdef OSX_DARWIN
+#if HAVE_GMTIME_R
+ t = gmtime_r(¤t_time, &dummy);
+#elif FEATURE_PTHREAD
pthread_mutex_lock(&gmtime_mutex);
t = gmtime(¤t_time);
pthread_mutex_unlock(&gmtime_mutex);
-#elif HAVE_GMTIME_R
- t = gmtime_r(¤t_time, &dummy);
#else
t = gmtime(¤t_time);
#endif
dnl Process this file with autoconf to produce a configure script.
dnl
-dnl $Id: configure.in,v 1.92 2006/08/17 17:09:49 fabiankeil Exp $
+dnl $Id: configure.in,v 1.93 2006/09/22 01:26:20 hal9 Exp $
dnl
dnl Written by and Copyright (C) 2001 - 2004 the SourceForge
dnl Privoxy team. http://www.privoxy.org/
dnl Temple Place - Suite 330, Boston, MA 02111-1307, USA.
dnl
dnl $Log: configure.in,v $
+dnl Revision 1.93 2006/09/22 01:26:20 hal9
+dnl Set version to 3.0.5 BETA for hopefully release this weekend.
+dnl
dnl Revision 1.92 2006/08/17 17:09:49 fabiankeil
dnl Added check for timegm().
dnl
dnl AutoConf Initialization
dnl =================================================================
-AC_REVISION($Revision: 1.92 $)
+AC_REVISION($Revision: 1.93 $)
AC_INIT(jcc.c)
if test ! -f config.h.in; then
AC_TYPE_SIGNAL
dnl uncommenting does not work for swa. suse linux
dnl AC_FUNC_STAT
-AC_CHECK_FUNCS([atexit getcwd gethostbyaddr gethostbyname inet_ntoa localtime_r memchr memmove memset random regcomp select setlocale socket strchr strdup strerror strftime strptime strstr strtoul timegm])
+AC_CHECK_FUNCS([atexit getcwd gethostbyaddr gethostbyaddr_r gethostbyname gethostbyname_r inet_ntoa localtime_r memchr memmove memset random regcomp select setlocale socket strchr strdup strerror strftime strptime strstr strtoul timegm])
dnl =================================================================
-const char errlog_rcs[] = "$Id: errlog.c,v 1.44 2006/08/18 16:03:16 david__schmidt Exp $";
+const char errlog_rcs[] = "$Id: errlog.c,v 1.45 2006/08/21 11:15:54 david__schmidt Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/errlog.c,v $
*
* Revisions :
* $Log: errlog.c,v $
+ * Revision 1.45 2006/08/21 11:15:54 david__schmidt
+ * MS Visual C++ build updates
+ *
* Revision 1.44 2006/08/18 16:03:16 david__schmidt
* Tweak for OS/2 build happiness.
*
#include <errno.h>
#include <assert.h>
-#ifdef FEATURE_PTHREAD
-#include <pthread.h>
-#endif /* def FEATURE_PTHREAD */
#ifdef _WIN32
#ifndef STRICT
time (&now);
#ifdef HAVE_LOCALTIME_R
tm_now = *localtime_r(&now, &tm_now);
-#elif OSX_DARWIN
+#elif FEATURE_PTHREAD
pthread_mutex_lock(&localtime_mutex);
tm_now = *localtime (&now);
pthread_mutex_unlock(&localtime_mutex);
time (&now);
#ifdef HAVE_GMTIME_R
gmt = *gmtime_r(&now, &gmt);
-#elif OSX_DARWIN
+#elif FEATURE_PTHREAD
pthread_mutex_lock(&gmtime_mutex);
gmt = *gmtime(&now);
pthread_mutex_unlock(&gmtime_mutex);
#endif
#ifdef HAVE_LOCALTIME_R
tm_now = localtime_r(&now, &dummy);
-#elif OSX_DARWIN
+#elif FEATURE_PTHREAD
pthread_mutex_lock(&localtime_mutex);
tm_now = localtime (&now);
pthread_mutex_unlock(&localtime_mutex);
-const char jbsockets_rcs[] = "$Id: jbsockets.c,v 1.39 2006/08/03 02:46:41 david__schmidt Exp $";
+const char jbsockets_rcs[] = "$Id: jbsockets.c,v 1.40 2006/09/02 15:36:42 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/jbsockets.c,v $
*
* Revisions :
* $Log: jbsockets.c,v $
+ * Revision 1.40 2006/09/02 15:36:42 fabiankeil
+ * Follow the OpenBSD port's lead and protect the resolve
+ * functions on OpenBSD as well.
+ *
* Revision 1.39 2006/08/03 02:46:41 david__schmidt
* Incorporate Fabian Keil's patch work:\rhttp://www.fabiankeil.de/sourcecode/privoxy/
*
#include "project.h"
-#if defined(OSX_DARWIN) || defined(__OpenBSD__)
+#ifdef FEATURE_PTHREAD
#include "jcc.h"
/* jcc.h is for mutex semaphores only */
-#endif /* defined(OSX_DARWIN) || defined(__OpenBSD__) */
+#endif /* def FEATURE_PTHREAD */
#include "jbsockets.h"
#include "filters.h"
{
host = NULL;
}
-#elif defined(OSX_DARWIN) || defined(__OpenBSD__)
+#elif FEATURE_PTHREAD
pthread_mutex_lock(&gethostbyaddr_mutex);
host = gethostbyaddr((const char *)&server.sin_addr,
sizeof(server.sin_addr), AF_INET);
{
hostp = NULL;
}
-#elif defined(OSX_DARWIN) || defined(__OpenBSD__)
+#elif FEATURE_PTHREAD
pthread_mutex_lock(&gethostbyname_mutex);
while ( NULL == (hostp = gethostbyname(host))
&& (h_errno == TRY_AGAIN) && (dns_retries++ < 10) )
-const char jcc_rcs[] = "$Id: jcc.c,v 1.105 2006/11/06 14:26:02 fabiankeil Exp $";
+const char jcc_rcs[] = "$Id: jcc.c,v 1.106 2006/11/06 19:58:23 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/jcc.c,v $
*
* Revisions :
* $Log: jcc.c,v $
+ * Revision 1.106 2006/11/06 19:58:23 fabiankeil
+ * Move pthread.h inclusion from jcc.c to jcc.h.
+ * Fixes build on x86-freebsd1 (FreeBSD 5.4-RELEASE).
+ *
* Revision 1.105 2006/11/06 14:26:02 fabiankeil
* Don't exit after receiving the second SIGHUP on Solaris.
*
#define sleep(N) DosSleep(((N) * 100))
#endif
-#if defined(OSX_DARWIN) || defined(__OpenBSD__)
-#ifdef OSX_DARWIN
-/*
- * Hit OSX over the head with a hammer. Protect all *_r functions.
- */
+#ifdef FEATURE_PTHREAD
+pthread_mutex_t log_mutex;
+pthread_mutex_t log_init_mutex;
+
+#ifndef HAVE_GMTIME_R
pthread_mutex_t gmtime_mutex;
+#endif /* ndef HAVE_GMTIME_R */
+
+#ifndef HAVE_LOCALTIME_R
pthread_mutex_t localtime_mutex;
-#endif /* def OSX_DARWIN */
-/*
- * Protect only the resolve functions for OpenBSD.
- */
+#endif /* ndef HAVE_GMTIME_R */
+
+#ifndef HAVE_GETHOSTBYADDR_R
pthread_mutex_t gethostbyaddr_mutex;
-pthread_mutex_t gethostbyname_mutex;
-#endif /* defined(OSX_DARWIN) || defined(__OpenBSD__) */
+#endif /* ndef HAVE_GETHOSTBYADDR_R */
-#ifdef FEATURE_PTHREAD
-pthread_mutex_t log_mutex;
-pthread_mutex_t log_init_mutex;
+#ifndef HAVE_GETHOSTBYNAME_R
+pthread_mutex_t gethostbyname_mutex;
+#endif /* ndef HAVE_GETHOSTBYNAME_R */
#endif /* FEATURE_PTHREAD */
#if defined(unix) || defined(__EMX__)
InitWin32();
#endif
-#if defined(OSX_DARWIN) || defined(__OpenBSD__)
+#ifdef FEATURE_PTHREAD
/*
* Prepare global mutex semaphores
*/
-#ifdef OSX_DARWIN
+ pthread_mutex_init(&log_mutex,0);
+ pthread_mutex_init(&log_init_mutex,0);
+
+#ifndef HAVE_GMTIME_R
pthread_mutex_init(&gmtime_mutex,0);
+#endif /* ndef HAVE_GMTIME_R */
+
+#ifndef HAVE_LOCALTIME_R
pthread_mutex_init(&localtime_mutex,0);
-#endif /* def OSX_DARWIN */
+#endif /* ndef HAVE_GMTIME_R */
+
+#ifndef HAVE_GETHOSTBYADDR_R
pthread_mutex_init(&gethostbyaddr_mutex,0);
- pthread_mutex_init(&gethostbyname_mutex,0);
-#endif /* defined(OSX_DARWIN) || defined(__OpenBSD__) */
+#endif /* ndef HAVE_GETHOSTBYADDR_R */
-#ifdef FEATURE_PTHREAD
- pthread_mutex_init(&log_mutex,0);
- pthread_mutex_init(&log_init_mutex,0);
+#ifndef HAVE_GETHOSTBYNAME_R
+ pthread_mutex_init(&gethostbyname_mutex,0);
+#endif /* ndef HAVE_GETHOSTBYNAME_R */
#endif /* FEATURE_PTHREAD */
#ifdef HAVE_RANDOM
#ifndef JCC_H_INCLUDED
#define JCC_H_INCLUDED
-#define JCC_H_VERSION "$Id: jcc.h,v 1.16 2006/09/02 15:36:42 fabiankeil Exp $"
+#define JCC_H_VERSION "$Id: jcc.h,v 1.17 2006/11/06 19:58:23 fabiankeil Exp $"
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/jcc.h,v $
*
* Revisions :
* $Log: jcc.h,v $
+ * Revision 1.17 2006/11/06 19:58:23 fabiankeil
+ * Move pthread.h inclusion from jcc.c to jcc.h.
+ * Fixes build on x86-freebsd1 (FreeBSD 5.4-RELEASE).
+ *
* Revision 1.16 2006/09/02 15:36:42 fabiankeil
* Follow the OpenBSD port's lead and protect the resolve
* functions on OpenBSD as well.
#include <pthread.h>
extern pthread_mutex_t log_mutex;
extern pthread_mutex_t log_init_mutex;
-#if defined(OSX_DARWIN) || defined(__OpenBSD__)
-#ifdef OSX_DARWIN
+
+#ifndef HAVE_GMTIME_R
extern pthread_mutex_t gmtime_mutex;
+#endif /* ndef HAVE_GMTIME_R */
+
+#ifndef HAVE_LOCALTIME_R
extern pthread_mutex_t localtime_mutex;
-#endif /* def OSX_DARWIN */
+#endif /* ndef HAVE_GMTIME_R */
+
+#ifndef HAVE_GETHOSTBYADDR_R
extern pthread_mutex_t gethostbyaddr_mutex;
+#endif /* ndef HAVE_GETHOSTBYADDR_R */
+
+#ifndef HAVE_GETHOSTBYNAME_R
extern pthread_mutex_t gethostbyname_mutex;
-#endif /* defined(OSX_DARWIN) || defined(__OpenBSD__) */
+#endif /* ndef HAVE_GETHOSTBYNAME_R */
#endif /* FEATURE_PTHREAD */
/* Functions */
-const char parsers_rcs[] = "$Id: parsers.c,v 1.73 2006/09/23 13:26:38 roro Exp $";
+const char parsers_rcs[] = "$Id: parsers.c,v 1.74 2006/10/02 16:59:12 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/parsers.c,v $
*
* Revisions :
* $Log: parsers.c,v $
+ * Revision 1.74 2006/10/02 16:59:12 fabiankeil
+ * The special header "X-Filter: No" now disables
+ * header filtering as well.
+ *
* Revision 1.73 2006/09/23 13:26:38 roro
* Replace TABs by spaces in source code.
*
#include "project.h"
-#ifdef OSX_DARWIN
-#include <pthread.h>
+#ifdef FEATURE_PTHREAD
#include "jcc.h"
/* jcc.h is for mutex semapores only */
-#endif /* def OSX_DARWIN */
+#endif /* def FEATURE_PTHREAD */
#include "list.h"
#include "parsers.h"
#include "encode.h"
now = time(NULL);
#ifdef HAVE_GMTIME_R
timeptr = gmtime_r(&now, &gmt);
-#elif OSX_DARWIN
+#elif FEATURE_PTHREAD
pthread_mutex_lock(&gmtime_mutex);
timeptr = gmtime(&now);
pthread_mutex_unlock(&gmtime_mutex);
last_modified += rtime;
#ifdef HAVE_GMTIME_R
timeptr = gmtime_r(&last_modified, &gmt);
-#elif OSX_DARWIN
+#elif FEATURE_PTHREAD
pthread_mutex_lock(&gmtime_mutex);
timeptr = gmtime(&last_modified);
pthread_mutex_unlock(&gmtime_mutex);
tm += rtime * (negative ? -1 : 1);
#ifdef HAVE_GMTIME_R
timeptr = gmtime_r(&tm, &gmt);
-#elif OSX_DARWIN
+#elif FEATURE_PTHREAD
pthread_mutex_lock(&gmtime_mutex);
timeptr = gmtime(&tm);
pthread_mutex_unlock(&gmtime_mutex);
time (&now);
#ifdef HAVE_LOCALTIME_R
tm_now = *localtime_r(&now, &tm_now);
-#elif OSX_DARWIN
+#elif FEATURE_PTHREAD
pthread_mutex_lock(&localtime_mutex);
tm_now = *localtime (&now);
pthread_mutex_unlock(&localtime_mutex);