--------------------- PatchSet 1412 Date: 2001/01/28 20:54:59 Author: rbcollins Branch: rbcollins_filters Tag: (none) Log: couple of bugfixes on reply body acls Members: src/client_side.c:1.1.1.3.4.1.4.15.2.5->1.1.1.3.4.1.4.15.2.6 src/http.c:1.1.1.3.4.1.4.12.2.4->1.1.1.3.4.1.4.12.2.5 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.5 retrieving revision 1.1.1.3.4.1.4.15.2.6 diff -u -r1.1.1.3.4.1.4.15.2.5 -r1.1.1.3.4.1.4.15.2.6 --- squid/src/client_side.c 28 Jan 2001 13:24:13 -0000 1.1.1.3.4.1.4.15.2.5 +++ squid/src/client_side.c 28 Jan 2001 20:54:59 -0000 1.1.1.3.4.1.4.15.2.6 @@ -1,6 +1,6 @@ /* - * $Id: client_side.c,v 1.1.1.3.4.1.4.15.2.5 2001/01/28 13:24:13 rbcollins Exp $ + * $Id: client_side.c,v 1.1.1.3.4.1.4.15.2.6 2001/01/28 20:54:59 rbcollins Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -1972,8 +1972,9 @@ temp_filter->filter(buf,len,filter_list, temp_filter, flags, temp_filter->data); return; } - +#if 0 if (buf && len) { +#endif #if 0 http->out.offset += len; check_size += body_size; @@ -1996,8 +1997,10 @@ if (free_te & TE_CHUNK_B) http->flags.done_copying = 1; +#if 0 } else temp_filter->filter(NULL, 0, filter_list, temp_filter, flags | FILTER_EOF, temp_filter->data); +#endif #if 0 if (!http->request->range && http->request->method == METHOD_GET) assert(check_size == size); @@ -2225,7 +2228,28 @@ } rep = clientBuildReply(http, buf, size); if (rep && clientReplyBodyTooLarge(rep->content_length)) { - ErrorState *err = errorCon(ERR_TOO_BIG, HTTP_FORBIDDEN); + /* the following two list removals deal + * wuth resetting the dynamically attached code modules + * so the error doesn't get handled twice! + */ + ErrorState *err; + { + /* remove any installed filters */ + dlink_node *link,*tmplink; + link=http->repfilters.head; + while (link) { + tmplink=link; + link=link->next; + dlinkDelete(tmplink, &http->repfilters); + xfree(tmplink->data); + } + } + while (http->te_translations) { + TE_list *tf = http->te_translations; + http->te_translations = http->te_translations->next; + xfree (tf); + } + err = errorCon(ERR_TOO_BIG, HTTP_FORBIDDEN); err->request = requestLink(http->request); storeUnregister(http->sc, http->entry, http); http->sc = NULL; @@ -2252,7 +2276,7 @@ RequestMethodStr[http->request->method], http->uri, rv ? "ALLOWED" : "DENIED", AclMatchedName ? AclMatchedName : "NO ACL's"); - if (rv!=1 && rep->sline.status!=HTTP_FORBIDDEN) { + if (!rv && rep->sline.status!=HTTP_FORBIDDEN) { /* the if above is slightly broken, but there is no way * to tell if this is a squid generated error page, or one from * upstream at this point. */ @@ -2277,6 +2301,7 @@ http->te_translations = http->te_translations->next; xfree (tf); } + debug(33,8)("********* DENYING ACCESSS ************\n"); assert(http->repfilters.head==NULL); err = errorCon(ERR_ACCESS_DENIED, HTTP_FORBIDDEN); err->request = requestLink(http->request); 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.4 retrieving revision 1.1.1.3.4.1.4.12.2.5 diff -u -r1.1.1.3.4.1.4.12.2.4 -r1.1.1.3.4.1.4.12.2.5 --- squid/src/http.c 26 Jan 2001 13:18:33 -0000 1.1.1.3.4.1.4.12.2.4 +++ squid/src/http.c 28 Jan 2001 20:54:59 -0000 1.1.1.3.4.1.4.12.2.5 @@ -1,6 +1,6 @@ /* - * $Id: http.c,v 1.1.1.3.4.1.4.12.2.4 2001/01/26 13:18:33 rbcollins Exp $ + * $Id: http.c,v 1.1.1.3.4.1.4.12.2.5 2001/01/28 20:54:59 rbcollins Exp $ * * DEBUG: section 11 Hypertext Transfer Protocol (HTTP) * AUTHOR: Harvest Derived @@ -539,7 +539,7 @@ httpState->eof = 1; /* TODO: optimise this out: it becomes a call to the filter chain * with FILTER_EOF set */ - if (httpState->reply_hdr_state < 2) + if (httpState->reply_hdr_state < 2) { /* * Yes Henrik, there is a point to doing this. When we * called httpProcessReplyHeader() before, we didn't find @@ -548,6 +548,8 @@ */ httpProcessReplyHeader(httpState, buf, len); te_build_decode_xlate_list(&entry->mem_obj->reply->header, &entry->mem_obj->reply->decode_translations); + } + /* we should call the filter list to push out any buffered data */ fwdComplete(httpState->fwd); comm_close(fd); } else { @@ -837,7 +839,8 @@ assert(filters->node.next==NULL); - storeAppend(entry,buf,len); + if (!EBIT_TEST(entry->flags, ENTRY_ABORTED)) + storeAppend(entry,buf,len); }