Automatic reloading of config file.
[privoxy.git] / filters.c
index cdcbba3..cab956f 100644 (file)
--- a/filters.c
+++ b/filters.c
@@ -1,4 +1,4 @@
-const char filters_rcs[] = "$Id: filters.c,v 1.4 2001/05/22 18:46:04 oes Exp $";
+const char filters_rcs[] = "$Id: filters.c,v 1.5 2001/05/25 22:34:30 jongfoster Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/filters.c,v $
@@ -38,6 +38,9 @@ const char filters_rcs[] = "$Id: filters.c,v 1.4 2001/05/22 18:46:04 oes Exp $";
  *
  * Revisions   :
  *    $Log: filters.c,v $
+ *    Revision 1.5  2001/05/25 22:34:30  jongfoster
+ *    Hard tabs->Spaces
+ *
  *    Revision 1.4  2001/05/22 18:46:04  oes
  *
  *    - Enabled filtering banners by size rather than URL
@@ -717,7 +720,7 @@ char *trust_url(struct http_request *http, struct client_state *csp)
    /* if splitting the domain fails, punt */
    if (url->dbuf == NULL) goto trust_url_not_trusted;
 
-   for (tl = trust_list; (t = *tl) ; tl++)
+   for (tl = csp->config->trust_list; (t = *tl) ; tl++)
    {
       if ((t->port == 0) || (t->port == rhttp->port))
       {
@@ -741,7 +744,7 @@ char *trust_url(struct http_request *http, struct client_state *csp)
                freez(url->dbuf);
                freez(url->dvec);
 
-               if ((fp = fopen(trustfile, "a")))
+               if ((fp = fopen(csp->config->trustfile, "a")))
                {
                   h = NULL;
 
@@ -919,7 +922,7 @@ int url_permissions(struct http_request *http, struct client_state *csp)
 
    if (((fl = csp->permissions_list) == NULL) || ((b = fl->f) == NULL))
    {
-      return(default_permissions);
+      return(csp->config->default_permissions);
    }
 
    *url = dsplit(http->host);
@@ -927,7 +930,7 @@ int url_permissions(struct http_request *http, struct client_state *csp)
    /* if splitting the domain fails, punt */
    if (url->dbuf == NULL)
    {
-      return(default_permissions);
+      return(csp->config->default_permissions);
    }
 
    for (b = b->next; NULL != b; b = b->next)
@@ -954,7 +957,7 @@ int url_permissions(struct http_request *http, struct client_state *csp)
 
    freez(url->dbuf);
    freez(url->dvec);
-   return(default_permissions);
+   return(csp->config->default_permissions);
 
 }
 
@@ -1298,12 +1301,12 @@ char *show_proxy_args(struct http_request *http, struct client_state *csp)
    }
 #endif /* def SPLIT_PROXY_ARGS */
    
-   s = strsav(s, proxy_args->header);
-   s = strsav(s, proxy_args->invocation);
+   s = strsav(s, csp->config->proxy_args->header);
+   s = strsav(s, csp->config->proxy_args->invocation);
 #ifdef STATISTICS
    s = add_stats(s);
 #endif /* def STATISTICS */
-   s = strsav(s, proxy_args->gateways);
+   s = strsav(s, csp->config->proxy_args->gateways);
 
 #ifdef SPLIT_PROXY_ARGS
    s = strsav(s, 
@@ -1416,7 +1419,7 @@ char *show_proxy_args(struct http_request *http, struct client_state *csp)
 
 #endif /* ndef SPLIT_PROXY_ARGS */
 
-   s = strsav(s, proxy_args->trailer);
+   s = strsav(s, csp->config->proxy_args->trailer);
 
    return(s);
 
@@ -1521,13 +1524,13 @@ char *ij_untrusted_url(struct http_request *http, struct client_state *csp)
 
    p = strsav(p, "<h3>The following referrers are trusted</h3>\n");
 
-   for (tl = trust_list; (t = *tl) ; tl++)
+   for (tl = csp->config->trust_list; (t = *tl) ; tl++)
    {
       sprintf(buf, "%s<br>\n", t->spec);
       p = strsav(p, buf);
    }
 
-   if (trust_info->next)
+   if (csp->config->trust_info->next)
    {
       struct list *l;
 
@@ -1541,7 +1544,7 @@ char *ij_untrusted_url(struct http_request *http, struct client_state *csp)
 
       p = strsav(p, buf);
 
-      for (l = trust_info->next; l ; l = l->next)
+      for (l = csp->config->trust_info->next; l ; l = l->next)
       {
          sprintf(buf,
             "<li> <a href=%s>%s</a><br>\n",