r3833 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Fri Feb 27 12:36:16 CET 2009


Author: phk
Date: 2009-02-27 12:36:16 +0100 (Fri, 27 Feb 2009)
New Revision: 3833

Modified:
   trunk/varnish-cache/bin/varnishd/cache.h
   trunk/varnish-cache/bin/varnishd/cache_backend.c
   trunk/varnish-cache/bin/varnishd/cache_fetch.c
   trunk/varnish-cache/bin/varnishd/cache_vrt.c
Log:
Don't pollute bereq.* in vcl_fetch{} with the reply



Modified: trunk/varnish-cache/bin/varnishd/cache.h
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache.h	2009-02-27 10:06:49 UTC (rev 3832)
+++ trunk/varnish-cache/bin/varnishd/cache.h	2009-02-27 11:36:16 UTC (rev 3833)
@@ -242,7 +242,7 @@
 #define BEREQ_MAGIC		0x3b6d250c
 	VTAILQ_ENTRY(bereq)	list;
 	struct ws		ws[1];
-	struct http		http[1];
+	struct http		http[2];
 };
 
 /* Storage -----------------------------------------------------------*/

Modified: trunk/varnish-cache/bin/varnishd/cache_backend.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_backend.c	2009-02-27 10:06:49 UTC (rev 3832)
+++ trunk/varnish-cache/bin/varnishd/cache_backend.c	2009-02-27 11:36:16 UTC (rev 3833)
@@ -163,7 +163,8 @@
 		WS_Init(bereq->ws, "bereq", bereq + 1, len);
 		VSL_stats->n_bereq++;
 	}
-	http_Setup(bereq->http, bereq->ws);
+	http_Setup(&bereq->http[0], bereq->ws);
+	http_Setup(&bereq->http[1], bereq->ws);
 	return (bereq);
 }
 

Modified: trunk/varnish-cache/bin/varnishd/cache_fetch.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_fetch.c	2009-02-27 10:06:49 UTC (rev 3832)
+++ trunk/varnish-cache/bin/varnishd/cache_fetch.c	2009-02-27 11:36:16 UTC (rev 3833)
@@ -329,9 +329,12 @@
 	if (sp->obj->objcore != NULL)		/* pass has no objcore */
 		AN(ObjIsBusy(sp->obj));
 	AN(sp->bereq);
+
+	/* Transmit request */
+
 	w = sp->wrk;
 	bereq = sp->bereq;
-	hp = bereq->http;
+	hp = &bereq->http[0];
 	is_head = (strcasecmp(http_GetReq(hp), "head") == 0);
 
 	sp->obj->xid = sp->xid;
@@ -371,6 +374,8 @@
 	/* XXX is this the right place? */
 	VSL_stats->backend_req++;
 
+	/* Receive response */
+
 	HTC_Init(htc, bereq->ws, vc->fd);
 	TCP_set_read_timeout(vc->fd, sp->first_byte_timeout);
 	do {
@@ -385,6 +390,8 @@
 		return (__LINE__);
 	}
 
+	hp = &bereq->http[1];
+
 	if (http_DissectResponse(sp->wrk, htc, hp)) {
 		VBE_ClosedFd(sp);
 		/* XXX: other cleanup ? */

Modified: trunk/varnish-cache/bin/varnishd/cache_vrt.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_vrt.c	2009-02-27 10:06:49 UTC (rev 3832)
+++ trunk/varnish-cache/bin/varnishd/cache_vrt.c	2009-02-27 11:36:16 UTC (rev 3833)
@@ -100,7 +100,7 @@
 		hp = sp->http;
 		break;
 	case HDR_BEREQ:
-		hp = sp->bereq->http;
+		hp = &sp->bereq->http[0];
 		break;
 	case HDR_RESP:
 		hp = sp->http;



More information about the varnish-commit mailing list