Oh well, rename the --enable-pcre-host-patterns option to
authorFabian Keil <fk@fabiankeil.de>
Sun, 6 Apr 2008 15:18:38 +0000 (15:18 +0000)
committerFabian Keil <fk@fabiankeil.de>
Sun, 6 Apr 2008 15:18:38 +0000 (15:18 +0000)
--enable-extended-host-patterns as it's not really PCRE syntax.

acconfig.h
configure.in
project.h
urlmatch.c

index 81eb72a..76dca51 100644 (file)
  *
  * Revisions   :
  *    $Log: acconfig.h,v $
  *
  * Revisions   :
  *    $Log: acconfig.h,v $
+ *    Revision 1.34  2008/04/06 14:54:26  fabiankeil
+ *    Use PCRE syntax in host patterns when configured
+ *    with --enable-pcre-host-patterns.
+ *
  *    Revision 1.33  2006/12/17 19:15:26  fabiankeil
  *    Added ./configure switch for FEATURE_GRACEFUL_TERMINATION.
  *
  *    Revision 1.33  2006/12/17 19:15:26  fabiankeil
  *    Added ./configure switch for FEATURE_GRACEFUL_TERMINATION.
  *
 /*
  * Allow PCRE syntax in host patterns.
  */
 /*
  * Allow PCRE syntax in host patterns.
  */
-#undef FEATURE_PCRE_HOST_PATTERNS
+#undef FEATURE_EXTENDED_HOST_PATTERNS
 
 /*
  * Use POSIX threads instead of native threads.
 
 /*
  * Use POSIX threads instead of native threads.
index 8a0e526..bc5ca2e 100644 (file)
@@ -1,6 +1,6 @@
 dnl Process this file with autoconf to produce a configure script.
 dnl 
 dnl Process this file with autoconf to produce a configure script.
 dnl 
-dnl $Id: configure.in,v 1.112 2008/03/27 18:27:22 fabiankeil Exp $
+dnl $Id: configure.in,v 1.113 2008/04/06 14:54:26 fabiankeil Exp $
 dnl 
 dnl Written by and Copyright (C) 2001 - 2007 the SourceForge
 dnl Privoxy team. http://www.privoxy.org/
 dnl 
 dnl Written by and Copyright (C) 2001 - 2007 the SourceForge
 dnl Privoxy team. http://www.privoxy.org/
@@ -28,6 +28,10 @@ dnl or write to the Free Software Foundation, Inc., 59
 dnl Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 dnl 
 dnl $Log: configure.in,v $
 dnl Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 dnl 
 dnl $Log: configure.in,v $
+dnl Revision 1.113  2008/04/06 14:54:26  fabiankeil
+dnl Use PCRE syntax in host patterns when configured
+dnl with --enable-pcre-host-patterns.
+dnl
 dnl Revision 1.112  2008/03/27 18:27:22  fabiankeil
 dnl Remove kill-popups action.
 dnl
 dnl Revision 1.112  2008/03/27 18:27:22  fabiankeil
 dnl Remove kill-popups action.
 dnl
@@ -517,7 +521,7 @@ dnl =================================================================
 dnl AutoConf Initialization
 dnl =================================================================
 
 dnl AutoConf Initialization
 dnl =================================================================
 
-AC_REVISION($Revision: 1.112 $)
+AC_REVISION($Revision: 1.113 $)
 AC_INIT(jcc.c)
 
 if test ! -f config.h.in; then
 AC_INIT(jcc.c)
 
 if test ! -f config.h.in; then
@@ -1316,10 +1320,10 @@ AC_ARG_ENABLE(graceful-termination,
   AC_DEFINE(FEATURE_GRACEFUL_TERMINATION)
 fi])
 
   AC_DEFINE(FEATURE_GRACEFUL_TERMINATION)
 fi])
 
-AC_ARG_ENABLE(pcre-host-patterns,
-[  --enable-pcre-host-patterns     Allow PCRE syntax in host patterns.],
+AC_ARG_ENABLE(extended-host-patterns,
+[  --enable-extended-host-patterns Allow extended regular expressions in host patterns.],
 [if test $enableval = yes; then
 [if test $enableval = yes; then
-  AC_DEFINE(FEATURE_PCRE_HOST_PATTERNS)
+  AC_DEFINE(FEATURE_EXTENDED_HOST_PATTERNS)
 fi])
 
 dnl pcre/pcrs is needed for CGI anyway, so
 fi])
 
 dnl pcre/pcrs is needed for CGI anyway, so
index ae3836b..bfe08ae 100644 (file)
--- a/project.h
+++ b/project.h
@@ -1,7 +1,7 @@
 #ifndef PROJECT_H_INCLUDED
 #define PROJECT_H_INCLUDED
 /** Version string. */
 #ifndef PROJECT_H_INCLUDED
 #define PROJECT_H_INCLUDED
 /** Version string. */
-#define PROJECT_H_VERSION "$Id: project.h,v 1.110 2008/03/29 12:13:46 fabiankeil Exp $"
+#define PROJECT_H_VERSION "$Id: project.h,v 1.111 2008/04/06 14:54:26 fabiankeil Exp $"
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/project.h,v $
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/project.h,v $
  *
  * Revisions   :
  *    $Log: project.h,v $
  *
  * Revisions   :
  *    $Log: project.h,v $
+ *    Revision 1.111  2008/04/06 14:54:26  fabiankeil
+ *    Use PCRE syntax in host patterns when configured
+ *    with --enable-pcre-host-patterns.
+ *
  *    Revision 1.110  2008/03/29 12:13:46  fabiankeil
  *    Remove send-wafer and send-vanilla-wafer actions.
  *
  *    Revision 1.110  2008/03/29 12:13:46  fabiankeil
  *    Remove send-wafer and send-vanilla-wafer actions.
  *
@@ -933,14 +937,14 @@ struct url_spec
        Used for debugging or display only.  */
    char  *spec;
 
        Used for debugging or display only.  */
    char  *spec;
 
-#ifdef FEATURE_PCRE_HOST_PATTERNS
+#ifdef FEATURE_EXTENDED_HOST_PATTERNS
    regex_t *host_regex;/**< Regex for host matching                          */
 #else
    char  *dbuffer;     /**< Buffer with '\0'-delimited domain name, or NULL to match all hosts. */
    char **dvec;        /**< List of pointers to the strings in dbuffer.       */
    int    dcount;      /**< How many parts to this domain? (length of dvec)   */
    int    unanchored;  /**< Bitmap - flags are ANCHOR_LEFT and ANCHOR_RIGHT.  */
    regex_t *host_regex;/**< Regex for host matching                          */
 #else
    char  *dbuffer;     /**< Buffer with '\0'-delimited domain name, or NULL to match all hosts. */
    char **dvec;        /**< List of pointers to the strings in dbuffer.       */
    int    dcount;      /**< How many parts to this domain? (length of dvec)   */
    int    unanchored;  /**< Bitmap - flags are ANCHOR_LEFT and ANCHOR_RIGHT.  */
-#endif /* defined FEATURE_PCRE_HOST_PATTERNS */
+#endif /* defined FEATURE_EXTENDED_HOST_PATTERNS */
 
    char  *port_list;   /**< List of acceptable ports, or NULL to match all ports */
 
 
    char  *port_list;   /**< List of acceptable ports, or NULL to match all ports */
 
@@ -952,11 +956,11 @@ struct url_spec
 /**
  * If you declare a static url_spec, this is the value to initialize it to zero.
  */
 /**
  * If you declare a static url_spec, this is the value to initialize it to zero.
  */
-#ifndef FEATURE_PCRE_HOST_PATTERNS
+#ifndef FEATURE_EXTENDED_HOST_PATTERNS
 #define URL_SPEC_INITIALIZER { NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, NULL }
 #else
 #define URL_SPEC_INITIALIZER { NULL, NULL, NULL, NULL, NULL, NULL }
 #define URL_SPEC_INITIALIZER { NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, NULL }
 #else
 #define URL_SPEC_INITIALIZER { NULL, NULL, NULL, NULL, NULL, NULL }
-#endif /* def FEATURE_PCRE_HOST_PATTERNS */
+#endif /* def FEATURE_EXTENDED_HOST_PATTERNS */
 
 /**
  * Constant for host part matching in URLs.  If set, indicates that the start of
 
 /**
  * Constant for host part matching in URLs.  If set, indicates that the start of
index 54089a7..871f2f1 100644 (file)
@@ -1,4 +1,4 @@
-const char urlmatch_rcs[] = "$Id: urlmatch.c,v 1.23 2008/04/05 12:19:20 fabiankeil Exp $";
+const char urlmatch_rcs[] = "$Id: urlmatch.c,v 1.24 2008/04/06 14:54:26 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/urlmatch.c,v $
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/urlmatch.c,v $
@@ -33,6 +33,10 @@ const char urlmatch_rcs[] = "$Id: urlmatch.c,v 1.23 2008/04/05 12:19:20 fabianke
  *
  * Revisions   :
  *    $Log: urlmatch.c,v $
  *
  * Revisions   :
  *    $Log: urlmatch.c,v $
+ *    Revision 1.24  2008/04/06 14:54:26  fabiankeil
+ *    Use PCRE syntax in host patterns when configured
+ *    with --enable-pcre-host-patterns.
+ *
  *    Revision 1.23  2008/04/05 12:19:20  fabiankeil
  *    Factor compile_host_pattern() out of create_url_spec().
  *
  *    Revision 1.23  2008/04/05 12:19:20  fabiankeil
  *    Factor compile_host_pattern() out of create_url_spec().
  *
@@ -635,7 +639,7 @@ jb_err parse_http_request(const char *req,
 }
 
 
 }
 
 
-#ifdef FEATURE_PCRE_HOST_PATTERNS
+#ifdef FEATURE_EXTENDED_HOST_PATTERNS
 /*********************************************************************
  *
  * Function    :  compile_host_pattern
 /*********************************************************************
  *
  * Function    :  compile_host_pattern
@@ -907,7 +911,7 @@ static int domain_match(const struct url_spec *pattern, const struct http_reques
    }
 
 }
    }
 
 }
-#endif /* def FEATURE_PCRE_HOST_PATTERNS */
+#endif /* def FEATURE_EXTENDED_HOST_PATTERNS */
 
 
 /*********************************************************************
 
 
 /*********************************************************************
@@ -1081,7 +1085,7 @@ void free_url_spec(struct url_spec *url)
    if (url == NULL) return;
 
    freez(url->spec);
    if (url == NULL) return;
 
    freez(url->spec);
-#ifdef FEATURE_PCRE_HOST_PATTERNS
+#ifdef FEATURE_EXTENDED_HOST_PATTERNS
    if (url->host_regex)
    {
       regfree(url->host_regex);
    if (url->host_regex)
    {
       regfree(url->host_regex);
@@ -1090,7 +1094,7 @@ void free_url_spec(struct url_spec *url)
 #else
    freez(url->dbuffer);
    freez(url->dvec);
 #else
    freez(url->dbuffer);
    freez(url->dvec);
-#endif /* ndef FEATURE_PCRE_HOST_PATTERNS */
+#endif /* ndef FEATURE_EXTENDED_HOST_PATTERNS */
    freez(url->path);
    freez(url->port_list);
    if (url->preg)
    freez(url->path);
    freez(url->port_list);
    if (url->preg)
@@ -1124,7 +1128,7 @@ int url_match(const struct url_spec *pattern,
 {
    /* XXX: these should probably be functions. */
 #define PORT_MATCHES ((NULL == pattern->port_list) || match_portlist(pattern->port_list, url->port))
 {
    /* XXX: these should probably be functions. */
 #define PORT_MATCHES ((NULL == pattern->port_list) || match_portlist(pattern->port_list, url->port))
-#ifdef FEATURE_PCRE_HOST_PATTERNS
+#ifdef FEATURE_EXTENDED_HOST_PATTERNS
 #define DOMAIN_MATCHES ((NULL == pattern->host_regex) || (0 == regexec(pattern->host_regex, url->host, 0, NULL, 0)))
 #else
 #define DOMAIN_MATCHES ((NULL == pattern->dbuffer) || (0 == domain_match(pattern, url)))
 #define DOMAIN_MATCHES ((NULL == pattern->host_regex) || (0 == regexec(pattern->host_regex, url->host, 0, NULL, 0)))
 #else
 #define DOMAIN_MATCHES ((NULL == pattern->dbuffer) || (0 == domain_match(pattern, url)))