--------------------- PatchSet 8988 Date: 2007/03/11 00:35:15 Author: hno Branch: http11 Tag: (none) Log: Fix 304 responses to use the configured HTTP version Members: src/HttpReply.c:1.16.14.3->1.16.14.4 src/client_side.c:1.154.2.8->1.154.2.9 src/protos.h:1.129.6.2->1.129.6.3 Index: squid/src/HttpReply.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/HttpReply.c,v retrieving revision 1.16.14.3 retrieving revision 1.16.14.4 diff -u -r1.16.14.3 -r1.16.14.4 --- squid/src/HttpReply.c 11 Mar 2007 00:11:24 -0000 1.16.14.3 +++ squid/src/HttpReply.c 11 Mar 2007 00:35:15 -0000 1.16.14.4 @@ -1,6 +1,6 @@ /* - * $Id: HttpReply.c,v 1.16.14.3 2007/03/11 00:11:24 hno Exp $ + * $Id: HttpReply.c,v 1.16.14.4 2007/03/11 00:35:15 hno Exp $ * * DEBUG: section 58 HTTP Reply (Response) * AUTHOR: Alex Rousskov @@ -198,7 +198,7 @@ #endif MemBuf -httpPacked304Reply(const HttpReply * rep) +httpPacked304Reply(const HttpReply * rep, int http11) { static const http_hdr_type ImsEntries[] = {HDR_DATE, HDR_CONTENT_TYPE, HDR_EXPIRES, HDR_LAST_MODIFIED, HDR_ETAG, /* eof */ HDR_OTHER}; @@ -210,7 +210,7 @@ memBufDefInit(&mb); packerToMemInit(&p, &mb); - memBufPrintf(&mb, "%s", "HTTP/1.1 304 Not Modified\r\n"); + memBufPrintf(&mb, "HTTP/1.%d 304 Not Modified\r\n", http11); for (t = 0; ImsEntries[t] != HDR_OTHER; ++t) if ((e = httpHeaderFindEntry(&rep->header, ImsEntries[t]))) httpHeaderEntryPackInto(e, &p); Index: squid/src/client_side.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/client_side.c,v retrieving revision 1.154.2.8 retrieving revision 1.154.2.9 diff -u -r1.154.2.8 -r1.154.2.9 --- squid/src/client_side.c 11 Mar 2007 00:31:27 -0000 1.154.2.8 +++ squid/src/client_side.c 11 Mar 2007 00:35:15 -0000 1.154.2.9 @@ -1,6 +1,6 @@ /* - * $Id: client_side.c,v 1.154.2.8 2007/03/11 00:31:27 hno Exp $ + * $Id: client_side.c,v 1.154.2.9 2007/03/11 00:35:15 hno Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -2316,7 +2316,7 @@ } if (is_modified == 0) { time_t timestamp = e->timestamp; - MemBuf mb = httpPacked304Reply(e->mem_obj->reply); + MemBuf mb = httpPacked304Reply(e->mem_obj->reply, http->conn->port->http11); http->log_type = LOG_TCP_IMS_HIT; storeClientUnregister(http->sc, e, http); http->sc = NULL; Index: squid/src/protos.h =================================================================== RCS file: /cvsroot/squid-sf//squid/src/protos.h,v retrieving revision 1.129.6.2 retrieving revision 1.129.6.3 diff -u -r1.129.6.2 -r1.129.6.3 --- squid/src/protos.h 24 Feb 2007 13:20:16 -0000 1.129.6.2 +++ squid/src/protos.h 11 Mar 2007 00:35:15 -0000 1.129.6.3 @@ -1,6 +1,6 @@ /* - * $Id: protos.h,v 1.129.6.2 2007/02/24 13:20:16 hno Exp $ + * $Id: protos.h,v 1.129.6.3 2007/03/11 00:35:15 hno Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -505,7 +505,7 @@ extern MemBuf httpPackedReply(http_version_t ver, http_status status, const char *ctype, squid_off_t clen, time_t lmt, time_t expires); /* construct 304 reply and pack it into MemBuf, return MemBuf */ -extern MemBuf httpPacked304Reply(const HttpReply * rep); +extern MemBuf httpPacked304Reply(const HttpReply * rep, int http11); /* update when 304 reply is received for a cached object */ extern void httpReplyUpdateOnNotModified(HttpReply * rep, HttpReply * freshRep); /* header manipulation */