r4678 - in branches/2.1: . varnish-cache/bin/varnishd varnish-cache/bin/varnishtest/tests varnish-cache/include varnish-cache/lib/libvarnish varnish-cache/lib/libvcl

tfheen at varnish-cache.org tfheen at varnish-cache.org
Mon Apr 19 13:16:21 CEST 2010


Author: tfheen
Date: 2010-04-19 13:16:21 +0200 (Mon, 19 Apr 2010)
New Revision: 4678

Modified:
   branches/2.1/
   branches/2.1/varnish-cache/bin/varnishd/cache.h
   branches/2.1/varnish-cache/bin/varnishd/cache_backend.h
   branches/2.1/varnish-cache/bin/varnishd/cache_backend_cfg.c
   branches/2.1/varnish-cache/bin/varnishd/cache_center.c
   branches/2.1/varnish-cache/bin/varnishd/cache_esi.c
   branches/2.1/varnish-cache/bin/varnishd/cache_http.c
   branches/2.1/varnish-cache/bin/varnishd/cache_vrt.c
   branches/2.1/varnish-cache/bin/varnishd/vparam.h
   branches/2.1/varnish-cache/bin/varnishtest/tests/c00019.vtc
   branches/2.1/varnish-cache/bin/varnishtest/tests/r00325.vtc
   branches/2.1/varnish-cache/bin/varnishtest/tests/r00416.vtc
   branches/2.1/varnish-cache/bin/varnishtest/tests/v00011.vtc
   branches/2.1/varnish-cache/include/vct.h
   branches/2.1/varnish-cache/include/vev.h
   branches/2.1/varnish-cache/lib/libvarnish/tcp.c
   branches/2.1/varnish-cache/lib/libvarnish/vev.c
   branches/2.1/varnish-cache/lib/libvcl/vcc_dir_random.c
Log:
Merge r4650: Add a HTTP_Copy() function and use it for the "rollback" copy of req.*

This was forgotten when number of HTTP headers was made dynamic.

The lack of this function may have made ESI includes weird.

Should be merged to 2.1




Property changes on: branches/2.1
___________________________________________________________________
Modified: svn:mergeinfo
   - /trunk:4637,4640,4643-4645,4647-4649
   + /trunk:4637,4640,4643-4645,4647-4650

Modified: branches/2.1/varnish-cache/bin/varnishd/cache.h
===================================================================
--- branches/2.1/varnish-cache/bin/varnishd/cache.h	2010-04-19 11:10:02 UTC (rev 4677)
+++ branches/2.1/varnish-cache/bin/varnishd/cache.h	2010-04-19 11:16:21 UTC (rev 4678)
@@ -135,6 +135,7 @@
 	HTTP_Obj = 3
 };
 
+/* NB: remember to update http_Copy() if you add fields */
 struct http {
 	unsigned		magic;
 #define HTTP_MAGIC		0x6428b5c9
@@ -514,6 +515,7 @@
 
 /* cache_http.c */
 unsigned HTTP_estimate(unsigned nhttp);
+void HTTP_Copy(struct http *to, const struct http * const fm);
 struct http *HTTP_create(void *p, unsigned nhttp);
 const char *http_StatusMessage(unsigned);
 unsigned http_EstimateWS(const struct http *fm, unsigned how, unsigned *nhd);


Property changes on: branches/2.1/varnish-cache/bin/varnishd/cache_backend.h
___________________________________________________________________
Modified: svn:mergeinfo
   - /trunk/varnish-cache/bin/varnishd/cache_backend.h:4637,4643-4645,4647-4649
   + /trunk/varnish-cache/bin/varnishd/cache_backend.h:4637,4643-4645,4647-4650


Property changes on: branches/2.1/varnish-cache/bin/varnishd/cache_backend_cfg.c
___________________________________________________________________
Modified: svn:mergeinfo
   - /trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c:4637,4643-4645,4647-4649
   + /trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c:4637,4643-4645,4647-4650

Modified: branches/2.1/varnish-cache/bin/varnishd/cache_center.c
===================================================================
--- branches/2.1/varnish-cache/bin/varnishd/cache_center.c	2010-04-19 11:10:02 UTC (rev 4677)
+++ branches/2.1/varnish-cache/bin/varnishd/cache_center.c	2010-04-19 11:16:21 UTC (rev 4678)
@@ -1132,7 +1132,7 @@
 	sp->ws_req = WS_Snapshot(sp->ws);
 
 	/* Catch original request, before modification */
-	*sp->http0 = *sp->http;
+	HTTP_Copy(sp->http0, sp->http);
 
 	if (done != 0) {
 		sp->err_code = done;

Modified: branches/2.1/varnish-cache/bin/varnishd/cache_esi.c
===================================================================
--- branches/2.1/varnish-cache/bin/varnishd/cache_esi.c	2010-04-19 11:10:02 UTC (rev 4677)
+++ branches/2.1/varnish-cache/bin/varnishd/cache_esi.c	2010-04-19 11:16:21 UTC (rev 4678)
@@ -896,7 +896,7 @@
 			http_save = *sp->http;
 
 		/* Reset request to status before we started messing with it */
-		*sp->http = *sp->http0;
+		HTTP_Copy(sp->http, sp->http0);
 
 		/* Take a workspace snapshot */
 		ws_wm = WS_Snapshot(sp->ws);

Modified: branches/2.1/varnish-cache/bin/varnishd/cache_http.c
===================================================================
--- branches/2.1/varnish-cache/bin/varnishd/cache_http.c	2010-04-19 11:10:02 UTC (rev 4677)
+++ branches/2.1/varnish-cache/bin/varnishd/cache_http.c	2010-04-19 11:16:21 UTC (rev 4678)
@@ -894,6 +894,22 @@
 
 /*--------------------------------------------------------------------*/
 
+void
+HTTP_Copy(struct http *to, const struct http * const fm)
+{
+
+	to->conds = fm->conds;
+	to->logtag = fm->logtag;
+	to->status = fm->status;
+	to->protover = fm->protover;
+	to->nhd = fm->nhd;
+	assert(fm->nhd <= to->shd);
+	memcpy(to->hd, fm->hd, fm->nhd * sizeof *to->hd);
+	memcpy(to->hdf, fm->hdf, fm->nhd * sizeof *to->hdf);
+}
+
+/*--------------------------------------------------------------------*/
+
 unsigned
 http_Write(struct worker *w, const struct http *hp, int resp)
 {

Modified: branches/2.1/varnish-cache/bin/varnishd/cache_vrt.c
===================================================================
--- branches/2.1/varnish-cache/bin/varnishd/cache_vrt.c	2010-04-19 11:10:02 UTC (rev 4677)
+++ branches/2.1/varnish-cache/bin/varnishd/cache_vrt.c	2010-04-19 11:16:21 UTC (rev 4678)
@@ -867,7 +867,7 @@
 VRT_Rollback(struct sess *sp)
 {
 
-	*sp->http = *sp->http0;
+	HTTP_Copy(sp->http, sp->http0);
 	WS_Reset(sp->ws, sp->ws_req);
 }
 


Property changes on: branches/2.1/varnish-cache/bin/varnishd/vparam.h
___________________________________________________________________
Modified: svn:mergeinfo
   - /trunk/varnish-cache/bin/varnishd/vparam.h:4637,4643-4645,4647-4649
   + /trunk/varnish-cache/bin/varnishd/vparam.h:4637,4643-4645,4647-4650


Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/c00019.vtc
___________________________________________________________________
Modified: svn:mergeinfo
   - /trunk/varnish-cache/bin/varnishtest/tests/c00019.vtc:4637,4643-4645,4647-4649
   + /trunk/varnish-cache/bin/varnishtest/tests/c00019.vtc:4637,4643-4645,4647-4650


Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/r00325.vtc
___________________________________________________________________
Modified: svn:mergeinfo
   - /trunk/varnish-cache/bin/varnishtest/tests/r00325.vtc:4637,4643-4645,4647-4649
   + /trunk/varnish-cache/bin/varnishtest/tests/r00325.vtc:4637,4643-4645,4647-4650


Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/r00416.vtc
___________________________________________________________________
Modified: svn:mergeinfo
   - /trunk/varnish-cache/bin/varnishtest/tests/r00416.vtc:4637,4643-4645,4647-4649
   + /trunk/varnish-cache/bin/varnishtest/tests/r00416.vtc:4637,4643-4645,4647-4650


Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/v00011.vtc
___________________________________________________________________
Modified: svn:mergeinfo
   - /trunk/varnish-cache/bin/varnishtest/tests/v00011.vtc:4637,4643-4645,4647-4649
   + /trunk/varnish-cache/bin/varnishtest/tests/v00011.vtc:4637,4643-4645,4647-4650


Property changes on: branches/2.1/varnish-cache/include/vct.h
___________________________________________________________________
Modified: svn:mergeinfo
   - /trunk/varnish-cache/include/vct.h:4637,4643-4645,4647-4649
   + /trunk/varnish-cache/include/vct.h:4637,4643-4645,4647-4650


Property changes on: branches/2.1/varnish-cache/include/vev.h
___________________________________________________________________
Modified: svn:mergeinfo
   - /trunk/varnish-cache/include/vev.h:4637,4643-4645,4647-4649
   + /trunk/varnish-cache/include/vev.h:4637,4643-4645,4647-4650


Property changes on: branches/2.1/varnish-cache/lib/libvarnish/tcp.c
___________________________________________________________________
Modified: svn:mergeinfo
   - /trunk/varnish-cache/lib/libvarnish/tcp.c:4637,4643-4645,4647-4649
   + /trunk/varnish-cache/lib/libvarnish/tcp.c:4637,4643-4645,4647-4650


Property changes on: branches/2.1/varnish-cache/lib/libvarnish/vev.c
___________________________________________________________________
Modified: svn:mergeinfo
   - /trunk/varnish-cache/lib/libvarnish/vev.c:4637,4643-4645,4647-4649
   + /trunk/varnish-cache/lib/libvarnish/vev.c:4637,4643-4645,4647-4650


Property changes on: branches/2.1/varnish-cache/lib/libvcl/vcc_dir_random.c
___________________________________________________________________
Modified: svn:mergeinfo
   - /trunk/varnish-cache/lib/libvcl/vcc_dir_random.c:4637,4643-4645,4647-4649
   + /trunk/varnish-cache/lib/libvcl/vcc_dir_random.c:4637,4643-4645,4647-4650




More information about the varnish-commit mailing list