Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals  

filters.c File Reference

Declares functions to parse/crunch headers and pages. More...


Defines

#define ijb_isdigit(__X)   isdigit((int)(unsigned char)(__X))

Functions

int match_portlist (const char *portlist, int port)
http_responseblock_url (struct client_state *csp)
char * pcrs_filter_response (struct client_state *csp)
char * gif_deanimate_response (struct client_state *csp)
int remove_chunked_transfer_coding (char *buffer, const size_t size)
void url_actions (struct http_request *http, struct client_state *csp)
void apply_url_actions (struct current_action_spec *action, struct http_request *http, struct url_actions *b)
const struct forward_specforward_url (struct http_request *http, struct client_state *csp)

Variables

const char filters_rcs [] = "$Id: filters.c,v 2.0 2002/06/04 14:34:21 jongfoster Exp $"
const char filters_h_rcs [] = FILTERS_H_VERSION


Detailed Description

Declares functions to parse/crunch headers and pages.

Functions declared include: `acl_addr', `add_stats', `block_acl', `block_imageurl', `block_url', `url_actions', `domain_split', `filter_popups', `forward_url', 'redirect_url', `ij_untrusted_url', `intercept_url', `pcrs_filter_respose', 'ijb_send_banner', and `trust_url'

Log:
filters.c,v
Revision 2.0 2002/06/04 14:34:21 jongfoster Moving source files to src/

Revision 1.58 2002/04/24 02:11:17 oes Jon's multiple AF patch: url_actions now evaluates rules from all AFs.

Revision 1.57 2002/04/08 20:38:34 swa fixed JB spelling

Revision 1.56 2002/04/05 15:51:24 oes

Revision 1.55 2002/04/02 16:13:51 oes Fix: No "Go there anyway" for SSL

Revision 1.54 2002/04/02 14:55:56 oes Bugfix: is_untrusted_url() now depends on FEATURE_TRUST, not FEATURE_COOKIE_JAR

Revision 1.53 2002/03/26 22:29:54 swa we have a new homepage!

Revision 1.52 2002/03/24 16:35:57 jongfoster Removing logo

Revision 1.51 2002/03/24 15:23:33 jongfoster Name changes

Revision 1.50 2002/03/24 13:25:43 swa name change related issues

Revision 1.49 2002/03/16 20:29:14 oes Cosmetics

Revision 1.48 2002/03/13 20:25:34 oes Better logging for content filters

Revision 1.47 2002/03/13 00:30:52 jongfoster Killing warnings Added option of always sending redirect for imageblock, currently disabled with if 0.

Revision 1.46 2002/03/12 01:42:49 oes Introduced modular filters

Revision 1.45 2002/03/08 16:47:50 oes Added choice beween GIF and PNG built-in images

Revision 1.44 2002/03/07 03:49:31 oes

Revision 1.43 2002/01/22 23:51:59 jongfoster Replacing strsav() with the safer string_append().

Adding missing html_encode() to error message generators. Where encoded and unencoded versions of a string were provided, removing the unencoded one.

Revision 1.42 2002/01/17 21:00:32 jongfoster Moving all our URL and URL pattern parsing code to urlmatch.c.

Using a single, simple url_match(pattern,url) function - rather than the 3-line match routine which was repeated all over the place.

Renaming free_url to free_url_spec, since it frees a struct url_spec.

Using parse_http_url() to parse URLs without faking a HTTP request line for parse_http_request().

Revision 1.41 2001/11/13 00:14:07 jongfoster Fixing stupid bug now I've figured out what || means. (It always returns 0 or 1, not one of it's paramaters.)

Revision 1.40 2001/10/26 17:37:55 oes

Revision 1.39 2001/10/25 03:40:48 david__schmidt Change in porting tactics: OS/2's EMX porting layer doesn't allow multiple threads to call select() simultaneously. So, it's time to do a real, live, native OS/2 port. See defines for __EMX__ (the porting layer) vs. __OS2__ (native). Both versions will work, but using __OS2__ offers multi-threading.

Revision 1.38 2001/10/23 21:32:33 jongfoster Adding error-checking to selected functions

Revision 1.37 2001/10/22 15:33:56 david__schmidt Special-cased OS/2 out of the Netscape-abort-on-404-in-js problem in filters.c. Added a FIXME in front of the offending code. I'll gladly put in a better/more robust fix for all parties if one is presented... It seems that just returning 200 instead of 404 would pretty much fix it for everyone, but I don't know all the history of the problem.

Revision 1.36 2001/10/10 16:44:16 oes Added match_portlist function

Revision 1.35 2001/10/07 15:41:23 oes Replaced 6 boolean members of csp with one bitmap (csp->flags)

New function remove_chunked_transfer_coding that strips chunked transfer coding to plain and is called by pcrs_filter_response and gif_deanimate_response if neccessary

Improved handling of zero-change re_filter runs

pcrs_filter_response and gif_deanimate_response now remove chunked transfer codeing before processing the body.

Revision 1.34 2001/09/20 15:49:36 steudten

Fix BUG: Change int size to size_t size in pcrs_filter_response(). See cgi.c fill_template().

Revision 1.33 2001/09/16 17:05:14 jongfoster Removing unused include showarg.h

Revision 1.32 2001/09/16 13:21:27 jongfoster Changes to use new list functions.

Revision 1.31 2001/09/16 11:38:02 jongfoster Splitting fill_template() into 2 functions: template_load() loads the file template_fill() performs the PCRS regexps. This is because the CGI edit interface has a "table row" template which is used many times in the page - this change means it's only loaded from disk once.

Revision 1.30 2001/09/16 11:00:10 jongfoster New function alloc_http_response, for symmetry with free_http_response

Revision 1.29 2001/09/13 23:32:40 jongfoster Moving image data to cgi.c rather than cgi.h Fixing a GPF under Win32 (and any other OS that protects global constants from being written to).

Revision 1.28 2001/09/10 10:18:51 oes Silenced compiler warnings

Revision 1.27 2001/08/05 16:06:20 jongfoster Modifiying "struct map" so that there are now separate header and "map_entry" structures. This means that functions which modify a map no longer need to return a pointer to the modified map. Also, it no longer reverses the order of the entries (which may be important with some advanced template substitutions).

Revision 1.26 2001/07/30 22:08:36 jongfoster Tidying up defines:

Revision 1.25 2001/07/26 10:09:46 oes Made browser detection a little less naive

Revision 1.24 2001/07/25 17:22:51 oes Added workaround for Netscape bug that prevents display of page when loading a component fails.

Revision 1.23 2001/07/23 13:40:12 oes Fixed bug that caused document body to be dropped when pcrs joblist was empty.

Revision 1.22 2001/07/18 12:29:34 oes

Revision 1.21 2001/07/13 13:59:53 oes Revision 1.20 2001/07/01 17:01:04 oes Added comments and missing return statement in is_untrusted_url()

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

Revision 1.17 2001/06/09 10:55:28 jongfoster Changing BUFSIZ ==> BUFFER_SIZE

Revision 1.16 2001/06/07 23:10:26 jongfoster Allowing unanchored domain patterns to back off and retry if they partially match. Optimized right-anchored patterns. Moving ACL and forward files into config file. Replacing struct gateway with struct forward_spec

Revision 1.15 2001/06/03 19:12:00 oes extracted-CGI relevant stuff

Revision 1.14 2001/06/01 10:30:55 oes Added optional left-anchoring to domaincmp

Revision 1.13 2001/05/31 21:21:30 jongfoster Permissionsfile / actions file changes:

Revision 1.12 2001/05/31 17:35:20 oes

Revision 1.11 2001/05/29 11:53:23 oes "See why" link added to "blocked" page

Revision 1.10 2001/05/29 09:50:24 jongfoster Unified blocklist/imagelist/permissionslist. File format is still under discussion, but the internal changes are (mostly) done.

Also modified interceptor behaviour:

Revision 1.9 2001/05/27 22:17:04 oes

Revision 1.8 2001/05/26 17:13:28 jongfoster Filled in a function comment.

Revision 1.7 2001/05/26 15:26:15 jongfoster ACL feature now provides more security by immediately dropping connections from untrusted hosts.

Revision 1.6 2001/05/26 00:28:36 jongfoster Automatic reloading of config file. Removed obsolete SIGHUP support (Unix) and Reload menu option (Win32). Most of the global variables have been moved to a new struct configuration_spec, accessed through csp->config->globalname Most of the globals remaining are used by the Win32 GUI.

Revision 1.5 2001/05/25 22:34:30 jongfoster Hard tabs->Spaces

Revision 1.4 2001/05/22 18:46:04 oes

Revision 1.3 2001/05/20 16:44:47 jongfoster Removing last hardcoded Junkbusters.com URLs.

Revision 1.2 2001/05/20 01:21:20 jongfoster Version 2.9.4 checkin.

Revision 1.1.1.1 2001/05/15 13:58:52 oes Initial import of version 2.9.3 source tree


Function Documentation

void apply_url_actions struct current_action_spec   action,
struct http_request   http,
struct url_actions   b
 

Applies a list of URL actions.

Parameters:
action  Destination.
http  Current URL
b  list of URL actions to apply
Returns:
N/A

struct http_response* block_url struct client_state   csp
 

Called from `chat'.

Check to see if we need to block this.

Parameters:
csp  Current client state (buffers, headers, etc...)
Returns:
NULL => unblocked, else HTTP block response

const struct forward_spec* forward_url struct http_request   http,
struct client_state   csp
 

Should we forward this to another proxy?

Parameters:
http  http_request request for current URL
csp  Current client state (buffers, headers, etc...)
Returns:
Pointer to forwarding information.

char* gif_deanimate_response struct client_state   csp
 

Deanimate the GIF image that has been accumulated in csp->iob->buf, set csp->content_length to the modified size and raise the CSP_FLAG_MODIFIED flag.

Parameters:
csp  Current client state (buffers, headers, etc...)
Returns:
a pointer to the (newly allocated) modified buffer. or NULL in case something went wrong.

int match_portlist const char *    portlist,
int    port
 

Check if a given number is covered by a comma separated list of numbers and ranges (a,b-c,d,..).

Parameters:
portlist  String with list
port  port to check
Returns:
0 => no match 1 => match

char* pcrs_filter_response struct client_state   csp
 

Ecexute all text substitutions from all applying +filter actions on the text buffer that's been accumulated in csp->iob->buf.

If this changes the contents, set csp->content_length to the modified size and raise the CSP_FLAG_MODIFIED flag.

Parameters:
csp  Current client state (buffers, headers, etc...)
Returns:
a pointer to the (newly allocated) modified buffer. or NULL if there were no hits or something went wrong

int remove_chunked_transfer_coding char *    buffer,
const size_t    size
 

In-situ remove the "chunked" transfer coding as defined in rfc2616 from a buffer.

Parameters:
buffer  Pointer to the text buffer
size  Number of bytes to be processed
Returns:
The new size, i.e. the number of bytes from buffer which are occupied by the stripped body, or 0 in case something went wrong

void url_actions struct http_request   http,
struct client_state   csp
 

Gets the actions for this URL.

Parameters:
http  http_request request for blocked URLs
csp  Current client state (buffers, headers, etc...)
Returns:
N/A


Variable Documentation

const char filters_h_rcs[] = FILTERS_H_VERSION
 

Version information about filters.h.

const char filters_rcs[] = "$Id: filters.c,v 2.0 2002/06/04 14:34:21 jongfoster Exp $"
 

Version information about filters.c.


Generated on Tue Jun 4 18:54:49 2002 for Privoxy 3.1.1 by doxygen1.2.15