X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=blobdiff_plain;f=parsers.c;h=3b08cf91ff2885399eff80377319e69f8e74f28c;hp=5e4c86f7a8482b9e4af37af5496c78432b268993;hb=36f5fa200c2685ff053539184c83f1d909f0da05;hpb=d86c86846cd3f630ffa5b398ab99aad0e53e01a3 diff --git a/parsers.c b/parsers.c index 5e4c86f7..3b08cf91 100644 --- a/parsers.c +++ b/parsers.c @@ -1,4 +1,4 @@ -const char parsers_rcs[] = "$Id: parsers.c,v 1.118 2007/12/28 16:56:35 fabiankeil Exp $"; +const char parsers_rcs[] = "$Id: parsers.c,v 1.121 2008/01/05 21:37:03 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/parsers.c,v $ @@ -44,6 +44,22 @@ const char parsers_rcs[] = "$Id: parsers.c,v 1.118 2007/12/28 16:56:35 fabiankei * * Revisions : * $Log: parsers.c,v $ + * Revision 1.121 2008/01/05 21:37:03 fabiankeil + * Let client_range() also handle Request-Range headers + * which apparently are still supported by many servers. + * + * Revision 1.120 2008/01/04 17:43:45 fabiankeil + * Improve the warning messages that get logged if the action files + * "enable" filters but no filters of that type have been loaded. + * + * Revision 1.119 2007/12/28 18:32:51 fabiankeil + * In server_content_type(): + * - Don't require leading white space when detecting image content types. + * - Change '... not replaced ...' message to sound less crazy if the text + * type actually is 'text/plain'. + * - Mark the 'text/plain == binary data' assumption for removal. + * - Remove a bunch of trailing white space. + * * Revision 1.118 2007/12/28 16:56:35 fabiankeil * Minor server_content_disposition() changes: * - Don't regenerate the header name all lower-case. @@ -864,6 +880,7 @@ const struct parsers client_patterns[] = { { "Accept-Language:", 16, client_accept_language }, { "if-none-match:", 14, client_if_none_match }, { "Range:", 6, client_range }, + { "Request-Range:", 14, client_range }, { "If-Range:", 9, client_range }, { "X-Filter:", 9, client_x_filter }, { "*", 0, crunch_client_header }, @@ -1695,7 +1712,8 @@ static jb_err header_tagger(struct client_state *csp, char *header) if (0 == found_filters) { - log_error(LOG_LEVEL_ERROR, "Unable to get current state of regex tagging."); + log_error(LOG_LEVEL_ERROR, "Inconsistent configuration: " + "tagging enabled, but no taggers available."); return(JB_ERR_OK); } @@ -1912,7 +1930,8 @@ static jb_err filter_header(struct client_state *csp, char **header) if (0 == found_filters) { - log_error(LOG_LEVEL_ERROR, "Unable to get current state of regexp filtering."); + log_error(LOG_LEVEL_ERROR, "Inconsistent configuration: " + "header filtering enabled, but no matching filters available."); return(JB_ERR_OK); } @@ -2193,10 +2212,6 @@ static jb_err server_content_type(struct client_state *csp, char **header) { csp->content_type |= CT_GIF; } - else if (strstr(*header, "image/jpeg")) - { - csp->content_type |= CT_JPEG; - } } /* @@ -3440,9 +3455,9 @@ jb_err client_x_filter(struct client_state *csp, char **header) * * Function : client_range * - * Description : Removes Range and If-Range headers if content - * filtering is enabled. If the client's version of - * the document has been altered by Privoxy, the server + * Description : Removes Range, Request-Range and If-Range headers if + * content filtering is enabled. If the client's version + * of the document has been altered by Privoxy, the server * could interpret the range differently than the client * intended in which case the user could end up with * corrupted content.