From: Fabian Keil Date: Wed, 25 Apr 2007 15:15:17 +0000 (+0000) Subject: Support crunching based on tags created by server-header taggers. X-Git-Tag: v_3_0_7~263 X-Git-Url: http://www.privoxy.org/gitweb/contact.html?a=commitdiff_plain;h=d06dfaa63787c7d7d796d9e8193b2668692d049b;p=privoxy.git Support crunching based on tags created by server-header taggers. --- diff --git a/jcc.c b/jcc.c index ad884096..caee73a3 100644 --- a/jcc.c +++ b/jcc.c @@ -1,4 +1,4 @@ -const char jcc_rcs[] = "$Id: jcc.c,v 1.130 2007/04/19 13:47:34 fabiankeil Exp $"; +const char jcc_rcs[] = "$Id: jcc.c,v 1.131 2007/04/22 13:24:50 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/jcc.c,v $ @@ -33,6 +33,10 @@ const char jcc_rcs[] = "$Id: jcc.c,v 1.130 2007/04/19 13:47:34 fabiankeil Exp $" * * Revisions : * $Log: jcc.c,v $ + * Revision 1.131 2007/04/22 13:24:50 fabiankeil + * Make HTTP snippets static (again). Add a Content-Type for those + * with content so the browser doesn't guess it based on the URL. + * * Revision 1.130 2007/04/19 13:47:34 fabiankeil * Move crunching and request line rebuilding out of chat(). * @@ -2255,6 +2259,12 @@ static void chat(struct client_state *csp) log_error(LOG_LEVEL_FATAL, "Out of memory parsing server header"); } + /* + * Shouldn't happen because this was the second sed run + * and tags are only created for the first one. + */ + assert(!crunch_response_triggered(csp)); + if (write_socket(csp->cfd, hdr, strlen(hdr)) || write_socket(csp->cfd, p != NULL ? p : csp->iob->cur, csp->content_length)) { @@ -2322,6 +2332,18 @@ static void chat(struct client_state *csp) return; } + if (crunch_response_triggered(csp)) + { + /* + * One of the tags created by a server-header + * tagger triggered a crunch. We already + * delivered the crunch response to the client + * and are done here after cleaning up. + */ + freez(hdr); + return; + } + hdrlen = strlen(hdr); if (write_socket(csp->cfd, hdr, hdrlen) @@ -2419,6 +2441,17 @@ static void chat(struct client_state *csp) log_error(LOG_LEVEL_FATAL, "Out of memory parsing server header"); } + if (crunch_response_triggered(csp)) + { + /* + * One of the tags created by a server-header + * tagger triggered a crunch. We already + * delivered the crunch response to the client + * and are done here after cleaning up. + */ + freez(hdr); + return; + } #ifdef FEATURE_KILL_POPUPS /* Start blocking popups if appropriate. */