r2075 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Mon Oct 1 14:25:38 CEST 2007


Author: phk
Date: 2007-10-01 14:25:37 +0200 (Mon, 01 Oct 2007)
New Revision: 2075

Modified:
   trunk/varnish-cache/bin/varnishd/cache_center.c
   trunk/varnish-cache/bin/varnishd/cache_fetch.c
   trunk/varnish-cache/bin/varnishd/cache_http.c
   trunk/varnish-cache/bin/varnishd/cache_synthetic.c
   trunk/varnish-cache/bin/varnishd/mgt_vcc.c
   trunk/varnish-cache/bin/varnishd/rfc2616.c
Log:
Remember to move numeric status when we filter one http to another.


Modified: trunk/varnish-cache/bin/varnishd/cache_center.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_center.c	2007-10-01 09:04:15 UTC (rev 2074)
+++ trunk/varnish-cache/bin/varnishd/cache_center.c	2007-10-01 12:25:37 UTC (rev 2075)
@@ -309,6 +309,8 @@
 	else
 		http_PutStatus(sp->wrk, sp->fd, sp->obj->http, 503);
 
+	sp->err_code = http_GetStatus(sp->obj->http);
+WSP(sp, SLT_Debug, "i %d err %d v %d c %d", i, sp->err_code, sp->obj->valid, sp->obj->cacheable);
 	VCL_fetch_method(sp);
 
 	switch (sp->handling) {

Modified: trunk/varnish-cache/bin/varnishd/cache_fetch.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_fetch.c	2007-10-01 09:04:15 UTC (rev 2074)
+++ trunk/varnish-cache/bin/varnishd/cache_fetch.c	2007-10-01 12:25:37 UTC (rev 2075)
@@ -284,14 +284,14 @@
 
 	vc = VBE_GetFd(sp);
 	if (vc == NULL)
-		return (1);
+		return (__LINE__);
 	WRK_Reset(w, &vc->fd);
 	http_Write(w, hp, 0);
 	if (WRK_Flush(w)) {
 		VBE_UpdateHealth(sp, vc, -1);
 		VBE_ClosedFd(sp->wrk, vc);
 		/* XXX: other cleanup ? */
-		return (1);
+		return (__LINE__);
 	}
 
 	/* XXX is this the right place? */
@@ -306,7 +306,7 @@
 		VBE_UpdateHealth(sp, vc, -2);
 		VBE_ClosedFd(sp->wrk, vc);
 		/* XXX: other cleanup ? */
-		return (1);
+		return (__LINE__);
 	}
 
 	sp->obj->entered = TIM_real();
@@ -338,7 +338,7 @@
 		WSL(sp->wrk, SLT_Debug, vc->fd, "Invalid Transfer-Encoding");
 		VBE_UpdateHealth(sp, vc, -3);
 		VBE_ClosedFd(sp->wrk, vc);
-		return (-1);
+		return (__LINE__);
 	} else if (strcmp(http_GetProto(hp), "HTTP/1.1")) {
 		switch (http_GetStatus(hp)) {
 			case 200:
@@ -359,7 +359,7 @@
 		}
 		VBE_UpdateHealth(sp, vc, -4);
 		VBE_ClosedFd(sp->wrk, vc);
-		return (-1);
+		return (__LINE__);
 	}
 
 	{

Modified: trunk/varnish-cache/bin/varnishd/cache_http.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_http.c	2007-10-01 09:04:15 UTC (rev 2074)
+++ trunk/varnish-cache/bin/varnishd/cache_http.c	2007-10-01 12:25:37 UTC (rev 2075)
@@ -598,6 +598,7 @@
 	CHECK_OBJ_NOTNULL(fm, HTTP_MAGIC);
 	CHECK_OBJ_NOTNULL(to, HTTP_MAGIC);
 	to->nhd = HTTP_HDR_FIRST;
+	to->status = fm->status;
 	for (u = HTTP_HDR_FIRST; u < fm->nhd; u++) {
 		if (fm->hdf[u] & HDF_FILTER)
 			continue;

Modified: trunk/varnish-cache/bin/varnishd/cache_synthetic.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_synthetic.c	2007-10-01 09:04:15 UTC (rev 2074)
+++ trunk/varnish-cache/bin/varnishd/cache_synthetic.c	2007-10-01 12:25:37 UTC (rev 2075)
@@ -56,6 +56,7 @@
 	double now;
 	int fd;
 
+	WSL_Flush(sp->wrk);
 	assert(status >= 100 && status <= 999);
 	CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
 	CHECK_OBJ_NOTNULL(sp->wrk, WORKER_MAGIC);

Modified: trunk/varnish-cache/bin/varnishd/mgt_vcc.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/mgt_vcc.c	2007-10-01 09:04:15 UTC (rev 2074)
+++ trunk/varnish-cache/bin/varnishd/mgt_vcc.c	2007-10-01 12:25:37 UTC (rev 2075)
@@ -98,15 +98,11 @@
     "\n"
     "sub vcl_hash {\n"
     "    set req.hash += req.url;\n"
-#if 1
-    "    set req.hash += req.http.host;\n"
-#else
     "    if (req.http.host) {\n"
     "        set req.hash += req.http.host;\n"
     "    } else {\n"
-    "        set req.hash += server.ip;\n"	/* XXX: see ticket 137 */
+    "        set req.hash += server.ip;\n"
     "    }\n"
-#endif
     "    hash;\n"
     "}\n"
     "\n"

Modified: trunk/varnish-cache/bin/varnishd/rfc2616.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/rfc2616.c	2007-10-01 09:04:15 UTC (rev 2074)
+++ trunk/varnish-cache/bin/varnishd/rfc2616.c	2007-10-01 12:25:37 UTC (rev 2075)
@@ -172,6 +172,7 @@
 	 * We do not support ranges yet, so 206 is out.
 	 */
 	sp->obj->response = http_GetStatus(hp);
+WSP(sp, SLT_Debug, "resp: %d", sp->obj->response);
 	switch (sp->obj->response) {
 	case 200: /* OK */
 	case 203: /* Non-Authoritative Information */




More information about the varnish-commit mailing list