Hard tabs->Spaces
[privoxy.git] / parsers.c
index ae6c1f4..4f51e0b 100644 (file)
--- a/parsers.c
+++ b/parsers.c
@@ -1,4 +1,4 @@
-const char parsers_rcs[] = "$Id: parsers.c,v 1.1.1.1 2001/05/15 13:59:01 oes Exp $";
+const char parsers_rcs[] = "$Id: parsers.c,v 1.3 2001/05/20 01:21:20 jongfoster Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/parsers.c,v $
@@ -41,6 +41,22 @@ const char parsers_rcs[] = "$Id: parsers.c,v 1.1.1.1 2001/05/15 13:59:01 oes Exp
  *
  * Revisions   :
  *    $Log: parsers.c,v $
+ *    Revision 1.3  2001/05/20 01:21:20  jongfoster
+ *    Version 2.9.4 checkin.
+ *    - Merged popupfile and cookiefile, and added control over PCRS
+ *      filtering, in new "permissionsfile".
+ *    - Implemented LOG_LEVEL_FATAL, so that if there is a configuration
+ *      file error you now get a message box (in the Win32 GUI) rather
+ *      than the program exiting with no explanation.
+ *    - Made killpopup use the PCRS MIME-type checking and HTTP-header
+ *      skipping.
+ *    - Removed tabs from "config"
+ *    - Moved duplicated url parsing code in "loaders.c" to a new funcition.
+ *    - Bumped up version number.
+ *
+ *    Revision 1.2  2001/05/17 23:02:36  oes
+ *     - Made referrer option accept 'L' as a substitute for '§'
+ *
  *    Revision 1.1.1.1  2001/05/15 13:59:01  oes
  *    Initial import of version 2.9.3 source tree
  *
@@ -111,8 +127,9 @@ const struct parsers client_patterns[] = {
 
 const struct interceptors intercept_patterns[] = {
    { "show-proxy-args",    14, show_proxy_args },
+   { "ijb-send-banner",    14, ijb_send_banner },
 #ifdef TRUST_FILES
-   { "ij-untrusted-url",   14, ij_untrusted_url },
+   { "ij-untrusted-url",   15, ij_untrusted_url },
 #endif /* def TRUST_FILES */
    { NULL, 0, NULL }
 };
@@ -120,10 +137,10 @@ const struct interceptors intercept_patterns[] = {
 const struct parsers server_patterns[] = {
    { "set-cookie:",        11, server_set_cookie },
    { "connection:",        11, crumble },
-#ifdef PCRS
+#if defined(PCRS) || defined(KILLPOPUPS)
    { "Content-Type:",      13, content_type },
    { "Content-Length:",    15, crumble },
-#endif /* def PCRS */
+#endif /* defined(PCRS) || defined(KILLPOPUPS) */
    { NULL, 0, NULL }
 };
 
@@ -707,7 +724,7 @@ char *crumble(const struct parsers *v, char *s, struct client_state *csp)
 }
 
 
-#ifdef PCRS
+#if defined(PCRS) || defined(KILLPOPUPS)
 
 /*********************************************************************
  *
@@ -734,7 +751,7 @@ char *content_type(const struct parsers *v, char *s, struct client_state *csp)
 
 }
 
-#endif /* def PCRS */
+#endif /* defined(PCRS) || defined(KILLPOPUPS) */
 
 
 /*********************************************************************
@@ -778,7 +795,7 @@ char *client_referrer(const struct parsers *v, char *s, struct client_state *csp
 
    if (*referrer == '@')
    {
-      if (csp->send_user_cookie)
+      if (csp->permissions & PERMIT_COOKIE_READ)
       {
          return(strdup(s));
       }
@@ -796,7 +813,7 @@ char *client_referrer(const struct parsers *v, char *s, struct client_state *csp
 
    if (*referrer == '§' || *referrer == 'L')
    {
-      if (csp->send_user_cookie)
+      if (csp->permissions & PERMIT_COOKIE_READ)
       {
          return(strdup(s));
       }
@@ -861,7 +878,7 @@ char *client_uagent(const struct parsers *v, char *s, struct client_state *csp)
 
    if (*uagent == '@')
    {
-      if (csp->send_user_cookie)
+      if (csp->permissions & PERMIT_COOKIE_READ)
       {
          return(strdup(s));
       }
@@ -910,7 +927,7 @@ char *client_ua(const struct parsers *v, char *s, struct client_state *csp)
 
    if (*uagent == '@')
    {
-      if (csp->send_user_cookie)
+      if (csp->permissions & PERMIT_COOKIE_READ)
       {
          return(strdup(s));
       }
@@ -984,7 +1001,7 @@ char *client_from(const struct parsers *v, char *s, struct client_state *csp)
  *********************************************************************/
 char *client_send_cookie(const struct parsers *v, char *s, struct client_state *csp)
 {
-   if (csp->send_user_cookie)
+   if (csp->permissions & PERMIT_COOKIE_READ)
    {
       enlist(csp->cookie_list, s + v->len + 1);
    }
@@ -1219,7 +1236,7 @@ char *server_set_cookie(const struct parsers *v, char *s, struct client_state *c
    }
 #endif /* def JAR_FILES */
 
-   if (csp->accept_server_cookie == 0)
+   if (!(csp->permissions & PERMIT_COOKIE_SET))
    {
       return(crumble(v, s, csp));
    }