r2003 - in branches/1.1: . bin/varnishd include
des at projects.linpro.no
des at projects.linpro.no
Mon Sep 24 09:37:30 CEST 2007
Author: des
Date: 2007-09-24 09:37:29 +0200 (Mon, 24 Sep 2007)
New Revision: 2003
Modified:
branches/1.1/
branches/1.1/bin/varnishd/cache_response.c
branches/1.1/include/http_headers.h
Log:
Merged revisions 1976-1977 via svnmerge from
svn+ssh://projects.linpro.no/svn/varnish/trunk/varnish-cache
........
r1976 | phk | 2007-09-21 11:49:05 +0200 (Fri, 21 Sep 2007) | 2 lines
Don't copy the Date: header from the object to the reply
........
r1977 | phk | 2007-09-21 11:49:44 +0200 (Fri, 21 Sep 2007) | 2 lines
Don't leak 50 bytes when creating the new Date: header.
........
Property changes on: branches/1.1
___________________________________________________________________
Name: svnmerge-integrated
- /trunk/varnish-cache:1-1722,1727-1729,1738,1743-1777,1779-1798,1800-1808,1810-1815,1817,1819,1823,1830-1838,1846,1853-1855,1857-1859,1862,1865-1868,1871-1880,1883-1884,1886,1896,1898,1902-1905,1907,1909,1912-1916,1920-1928,1935-1939,1941-1949,1955,1957-1958,1967-1968,1970-1974,1984,1986-1989,1991-1998
+ /trunk/varnish-cache:1-1722,1727-1729,1738,1743-1777,1779-1798,1800-1808,1810-1815,1817,1819,1823,1830-1838,1846,1853-1855,1857-1859,1862,1865-1868,1871-1880,1883-1884,1886,1896,1898,1902-1905,1907,1909,1912-1916,1920-1928,1935-1939,1941-1949,1955,1957-1958,1967-1968,1970-1974,1976-1977,1984,1986-1989,1991-1998
Modified: branches/1.1/bin/varnishd/cache_response.c
===================================================================
--- branches/1.1/bin/varnishd/cache_response.c 2007-09-23 14:36:05 UTC (rev 2002)
+++ branches/1.1/bin/varnishd/cache_response.c 2007-09-24 07:37:29 UTC (rev 2003)
@@ -112,7 +112,7 @@
void
RES_BuildHttp(struct sess *sp)
{
- char *time_str;
+ char time_str[30];
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
@@ -127,15 +127,8 @@
http_FilterFields(sp->wrk, sp->fd, sp->http, &sp->obj->http,
HTTPH_A_DELIVER);
- /* Replace Date header with current date instead of keeping the date
- * originally given by the backend when the object was fetched (which
- * could be a long time ago).
- */
- http_Unset(sp->http, H_Date);
- time_str = malloc(50);
- sprintf(time_str, "Date: ");
- TIM_format(TIM_real(), &(time_str[6]));
- http_SetHeader(sp->wrk, sp->fd, sp->http, time_str);
+ TIM_format(TIM_real(), time_str);
+ http_PrintfHeader(sp->wrk, sp->fd, sp->http, "Date: %s", time_str);
if (sp->xid != sp->obj->xid)
http_PrintfHeader(sp->wrk, sp->fd, sp->http,
Modified: branches/1.1/include/http_headers.h
===================================================================
--- branches/1.1/include/http_headers.h 2007-09-23 14:36:05 UTC (rev 2002)
+++ branches/1.1/include/http_headers.h 2007-09-24 07:37:29 UTC (rev 2003)
@@ -32,7 +32,7 @@
* b session field name
* c Request(1)/Response(2) bitfield
* d (obsolete)
- * e Supress header in pass from client to backend
+ * e Supress header in filter ops
* f unused
* g unused
*
@@ -70,7 +70,7 @@
HTTPH("Content-MD5", H_Content_MD5, 2, 0, 0, 0, 0) /* RFC2616 14.15 */
HTTPH("Content-Range", H_Content_Range, 2, 3, HTTPH_R_PASS|HTTPH_A_PASS|HTTPH_R_FETCH|HTTPH_A_INS, 0, 0) /* RFC2616 14.16 */
HTTPH("Content-Type", H_Content_Type, 2, 0, 0, 0, 0) /* RFC2616 14.17 */
-HTTPH("Date", H_Date, 2, 0, 0, 0, 0) /* RFC2616 14.18 */
+HTTPH("Date", H_Date, 2, 0, HTTPH_A_DELIVER, 0, 0) /* RFC2616 14.18 */
HTTPH("ETag", H_ETag, 2, 0, 0, 0, 0) /* RFC2616 14.19 */
HTTPH("Expect", H_Expect, 1, 0, 0, 0, 0) /* RFC2616 14.20 */
HTTPH("Expires", H_Expires, 2, 0, 0, 0, 0) /* RFC2616 14.21 */
More information about the varnish-commit
mailing list