--------------------- PatchSet 1487 Date: 2001/02/05 11:49:07 Author: rbcollins Branch: rbcollins_filters Tag: (none) Log: http_response filters implemented Members: src/client_side.c:1.1.1.3.4.1.4.15.2.19->1.1.1.3.4.1.4.15.2.20 src/filters.c:1.1.2.7->1.1.2.8 src/http.c:1.1.1.3.4.1.4.12.2.7->1.1.1.3.4.1.4.12.2.8 src/protos.h:1.1.1.3.8.11.2.9->1.1.1.3.8.11.2.10 src/modules/spy/spy.c:1.1.2.2->1.1.2.3 Index: squid/src/client_side.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/client_side.c,v retrieving revision 1.1.1.3.4.1.4.15.2.19 retrieving revision 1.1.1.3.4.1.4.15.2.20 diff -u -r1.1.1.3.4.1.4.15.2.19 -r1.1.1.3.4.1.4.15.2.20 --- squid/src/client_side.c 4 Feb 2001 22:13:48 -0000 1.1.1.3.4.1.4.15.2.19 +++ squid/src/client_side.c 5 Feb 2001 11:49:07 -0000 1.1.1.3.4.1.4.15.2.20 @@ -1,6 +1,6 @@ /* - * $Id: client_side.c,v 1.1.1.3.4.1.4.15.2.19 2001/02/04 22:13:48 rbcollins Exp $ + * $Id: client_side.c,v 1.1.1.3.4.1.4.15.2.20 2001/02/05 11:49:07 rbcollins Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -1382,7 +1382,7 @@ stringClean(&strConnection); } - filterBuildChain(Config.reply_filters, &http->repfilters, http, rep); + filterBuildChain(Config.reply_filters, &http->repfilters, http, rep, http->request); /* Handle Ranges */ if (request->range) Index: squid/src/filters.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/Attic/filters.c,v retrieving revision 1.1.2.7 retrieving revision 1.1.2.8 diff -u -r1.1.2.7 -r1.1.2.8 --- squid/src/filters.c 4 Feb 2001 22:13:48 -0000 1.1.2.7 +++ squid/src/filters.c 5 Feb 2001 11:49:08 -0000 1.1.2.8 @@ -1,6 +1,6 @@ /* - * $Id: filters.c,v 1.1.2.7 2001/02/04 22:13:48 rbcollins Exp $ + * $Id: filters.c,v 1.1.2.8 2001/02/05 11:49:08 rbcollins Exp $ * * DEBUG: section 83 Content Processing Filters * AUTHOR: Robert Collins @@ -138,7 +138,7 @@ * here. */ void -filterBuildChain(filterAccess *head, dlink_list *filter_list, clientHttpRequest * http, HttpReply *rep) { +filterBuildChain(filterAccess *head, dlink_list *filter_list, clientHttpRequest * http, HttpReply *rep, request_t *request) { aclCheck_t *ch; int rv; filterAccess *filter; @@ -146,7 +146,7 @@ filter=head; while (filter) { instance = filter->instance; - ch = aclChecklistCreate(filter->apply, http->request, NULL); + ch = aclChecklistCreate(filter->apply, request, NULL); ch->reply = rep; rv = aclCheckFast(filter->apply, ch); aclChecklistFree(ch); Index: squid/src/http.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/http.c,v retrieving revision 1.1.1.3.4.1.4.12.2.7 retrieving revision 1.1.1.3.4.1.4.12.2.8 diff -u -r1.1.1.3.4.1.4.12.2.7 -r1.1.1.3.4.1.4.12.2.8 --- squid/src/http.c 1 Feb 2001 23:13:14 -0000 1.1.1.3.4.1.4.12.2.7 +++ squid/src/http.c 5 Feb 2001 11:49:08 -0000 1.1.1.3.4.1.4.12.2.8 @@ -1,6 +1,6 @@ /* - * $Id: http.c,v 1.1.1.3.4.1.4.12.2.7 2001/02/01 23:13:14 rbcollins Exp $ + * $Id: http.c,v 1.1.1.3.4.1.4.12.2.8 2001/02/05 11:49:08 rbcollins Exp $ * * DEBUG: section 11 Hypertext Transfer Protocol (HTTP) * AUTHOR: Harvest Derived @@ -594,6 +594,9 @@ if (httpState->reply_hdr_state == 2) { http_status s = entry->mem_obj->reply->sline.status; te_build_decode_xlate_list(&entry->mem_obj->reply->header, &httpState->filters); + /* apply user configured filters */ + filterBuildChain(Config.response_filters, &httpState->filters, NULL, entry->mem_obj->reply , request); + /* Send the data to the store manager */ temp_filter=xmalloc(sizeof(FILTER_list)); temp_filter->filter=httpDoAppend; Index: squid/src/protos.h =================================================================== RCS file: /cvsroot/squid-sf//squid/src/protos.h,v retrieving revision 1.1.1.3.8.11.2.9 retrieving revision 1.1.1.3.8.11.2.10 diff -u -r1.1.1.3.8.11.2.9 -r1.1.1.3.8.11.2.10 --- squid/src/protos.h 4 Feb 2001 12:47:34 -0000 1.1.1.3.8.11.2.9 +++ squid/src/protos.h 5 Feb 2001 11:49:08 -0000 1.1.1.3.8.11.2.10 @@ -1,6 +1,6 @@ /* - * $Id: protos.h,v 1.1.1.3.8.11.2.9 2001/02/04 12:47:34 rbcollins Exp $ + * $Id: protos.h,v 1.1.1.3.8.11.2.10 2001/02/05 11:49:08 rbcollins Exp $ * * * SQUID Internet Object Cache http://squid.nlanr.net/Squid/ @@ -1312,4 +1312,4 @@ extern FILTER_instance *filterInstanceByName(const char *namestr, FILTER_instance **); extern void filterRegisterModule(const char *, ADDFILTERINSTANCE *, REMFILTERINSTANCE *); extern void filterDeregisterModule(const char *); -extern void filterBuildChain(filterAccess *, dlink_list *, clientHttpRequest * , HttpReply *); +extern void filterBuildChain(filterAccess *, dlink_list *, clientHttpRequest * , HttpReply *, request_t *); Index: squid/src/modules/spy/spy.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/modules/spy/Attic/spy.c,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -u -r1.1.2.2 -r1.1.2.3 --- squid/src/modules/spy/spy.c 3 Feb 2001 14:23:21 -0000 1.1.2.2 +++ squid/src/modules/spy/spy.c 5 Feb 2001 11:49:08 -0000 1.1.2.3 @@ -1,6 +1,6 @@ /* - * $Id: spy.c,v 1.1.2.2 2001/02/03 14:23:21 rbcollins Exp $ + * $Id: spy.c,v 1.1.2.3 2001/02/05 11:49:08 rbcollins Exp $ * * DEBUG: section 83 Content Processing Filters * AUTHOR: Robert Collins @@ -35,14 +35,10 @@ #include "squid.h" -/* The textreplace filter */ typedef struct _onunloadstate OnUnloadState; struct _onunloadstate { - /* allow for searching across buffer breaks */ - /* not implemented just yet :] */ - char *pos; - size_t seen; + char *instance; }; static REMOVEFILTER SpyFilter_Remove; @@ -92,7 +88,6 @@ * or copy it. For now, to save learning cbdata, I copy it */ state = xmalloc (sizeof (OnUnloadState)); - state->seen = 0; return state; }