--------------------- PatchSet 11753 Date: 2007/11/21 12:59:22 Author: hno Branch: HEAD Tag: (none) Log: Correctly update in-core headers on 304 replies - multivalue headers only got the last value saved - allow and "other" headers is allowed in 304 responses, don't ignore them - kill any old Age header Members: src/HttpHeader.c:1.97->1.98 src/HttpReply.c:1.63->1.64 Index: squid/src/HttpHeader.c =================================================================== RCS file: /cvsroot/squid/squid/src/HttpHeader.c,v retrieving revision 1.97 retrieving revision 1.98 diff -u -r1.97 -r1.98 --- squid/src/HttpHeader.c 20 Nov 2007 14:22:07 -0000 1.97 +++ squid/src/HttpHeader.c 21 Nov 2007 12:59:22 -0000 1.98 @@ -1,6 +1,6 @@ /* - * $Id: HttpHeader.c,v 1.97 2007/11/20 14:22:07 hno Exp $ + * $Id: HttpHeader.c,v 1.98 2007/11/21 12:59:22 hno Exp $ * * DEBUG: section 55 HTTP Header * AUTHOR: Alex Rousskov @@ -421,6 +421,12 @@ httpHeaderDelById(old, e->id); else httpHeaderDelByName(old, strBuf(e->name)); + } + pos = HttpHeaderInitPos; + while ((e = httpHeaderGetEntry(fresh, &pos))) { + /* deny bad guys (ok to check for HDR_OTHER) here */ + if (denied_mask && CBIT_TEST(*denied_mask, e->id)) + continue; httpHeaderAddClone(old, e); } Index: squid/src/HttpReply.c =================================================================== RCS file: /cvsroot/squid/squid/src/HttpReply.c,v retrieving revision 1.63 retrieving revision 1.64 diff -u -r1.63 -r1.64 --- squid/src/HttpReply.c 2 Jun 2007 18:52:14 -0000 1.63 +++ squid/src/HttpReply.c 21 Nov 2007 12:59:22 -0000 1.64 @@ -1,6 +1,6 @@ /* - * $Id: HttpReply.c,v 1.63 2007/06/02 18:52:14 hno Exp $ + * $Id: HttpReply.c,v 1.64 2007/11/21 12:59:22 hno Exp $ * * DEBUG: section 58 HTTP Reply (Response) * AUTHOR: Alex Rousskov @@ -42,9 +42,8 @@ static HttpHeaderMask Denied304HeadersMask; static http_hdr_type Denied304HeadersArr[] = { - HDR_ALLOW, HDR_CONTENT_ENCODING, HDR_CONTENT_LANGUAGE, HDR_CONTENT_LENGTH, - HDR_CONTENT_LOCATION, HDR_CONTENT_RANGE, HDR_LAST_MODIFIED, HDR_LINK, - HDR_OTHER + HDR_CONTENT_ENCODING, HDR_CONTENT_LANGUAGE, HDR_CONTENT_LENGTH, + HDR_CONTENT_LOCATION, HDR_CONTENT_RANGE }; /* local routines */ @@ -274,6 +273,7 @@ /* clean cache */ httpReplyHdrCacheClean(rep); /* update raw headers */ + httpHeaderDelById(&rep->header, HDR_AGE); httpHeaderUpdate(&rep->header, &freshRep->header, (const HttpHeaderMask *) &Denied304HeadersMask); /* init cache */