X-Git-Url: http://www.privoxy.org/gitweb/?a=blobdiff_plain;f=filters.c;h=0192314c63e1e823ee72fb06246744d18d929f03;hb=669e2ba1bd80ffbc68897ace3a8547140c7e9805;hp=3586be0bc618e8bce0862b9aaa3ccc731e8d4b27;hpb=8eb4a58566a5aa38aa94f372a3fdeed87bcef2f2;p=privoxy.git diff --git a/filters.c b/filters.c index 3586be0b..0192314c 100644 --- a/filters.c +++ b/filters.c @@ -1,4 +1,4 @@ -const char filters_rcs[] = "$Id: filters.c,v 1.17 2001/06/09 10:55:28 jongfoster Exp $"; +const char filters_rcs[] = "$Id: filters.c,v 1.19 2001/06/29 21:45:41 oes Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/filters.c,v $ @@ -38,6 +38,35 @@ const char filters_rcs[] = "$Id: filters.c,v 1.17 2001/06/09 10:55:28 jongfoster * * Revisions : * $Log: filters.c,v $ + * Revision 1.19 2001/06/29 21:45:41 oes + * Indentation, CRLF->LF, Tab-> Space + * + * Revision 1.18 2001/06/29 13:27:38 oes + * - Cleaned up, renamed and reorderd functions + * and improved comments + * + * - block_url: + * - Ported to CGI platform. Now delivers + * http_response or NULL + * - Unified HTML and GIF generation (moved image detection + * and GIF generation here from jcc.c:chat()) + * - Fixed HTTP status to: + * - 403 (Forbidden) for the "blocked" HTML message + * - 200 (OK) for GIF answers + * - 302 (Redirect) for redirect to GIF + * + * - trust_url: + * - Ported to CGI platform. Now delivers + * http_response or NULL + * - Separated detection of untrusted URL into + * (bool)is_untrusted_url + * - Added enforcement of untrusted requests + * + * - Moved redirect_url() from cgi.c to here + * and ported it to the CGI platform + * + * - Removed logentry from cancelled commit + * * Revision 1.17 2001/06/09 10:55:28 jongfoster * Changing BUFSIZ ==> BUFFER_SIZE * @@ -251,8 +280,7 @@ const char filters_h_rcs[] = FILTERS_H_VERSION; * Returns : 0 = FALSE (don't block) and 1 = TRUE (do block) * *********************************************************************/ -int block_acl(struct access_control_addr *dst, - struct client_state *csp) +int block_acl(struct access_control_addr *dst, struct client_state *csp) { struct access_control_list *acl = csp->config->acl; @@ -387,7 +415,7 @@ int acl_addr(char *aspec, struct access_control_addr *aca) struct http_response *block_url(struct client_state *csp) { char *p; - struct http_response *rsp; + struct http_response *rsp; struct map *exports = NULL; /* @@ -411,10 +439,10 @@ struct http_response *block_url(struct client_state *csp) * as specified by the relevant +image action */ #ifdef IMAGE_BLOCKING - if (((csp->action->flags & ACTION_IMAGE_BLOCKER) != 0) + if (((csp->action->flags & ACTION_IMAGE_BLOCKER) != 0) && is_imageurl(csp)) - { - /* determine HOW images should be blocked */ + { + /* determine HOW images should be blocked */ p = csp->action->string[ACTION_STRING_IMAGE_BLOCKER]; /* and handle accordingly: */ @@ -446,7 +474,7 @@ struct http_response *block_url(struct client_state *csp) */ { - exports = default_exports(csp, NULL); + exports = default_exports(csp, NULL); #ifdef FORCE_LOAD exports = map(exports, "force-prefix", 1, FORCE_PREFIX, 1); #else @@ -495,7 +523,7 @@ struct http_response *trust_url(struct client_state *csp) */ if (!is_untrusted_url(csp)) { - return NULL; + return NULL; } /* @@ -509,7 +537,7 @@ struct http_response *trust_url(struct client_state *csp) /* * Export the host, port, and referrer information - */ + */ exports = map(exports, "hostport", 1, csp->http->hostport, 1); exports = map(exports, "path", 1, csp->http->path, 1); exports = map(exports, "hostport-html", 1, html_encode(csp->http->hostport), 0); @@ -546,25 +574,23 @@ struct http_response *trust_url(struct client_state *csp) for (l = csp->config->trust_info->next; l ; l = l->next) { - sprintf(buf, - "