r484 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Tue Jul 18 12:32:40 CEST 2006


Author: phk
Date: 2006-07-18 12:32:40 +0200 (Tue, 18 Jul 2006)
New Revision: 484

Modified:
   trunk/varnish-cache/bin/varnishd/cache_pass.c
Log:
Use bigger buffersizes for pass mode

Terminate the sbuf with the reply headers properly.



Modified: trunk/varnish-cache/bin/varnishd/cache_pass.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_pass.c	2006-07-18 09:02:56 UTC (rev 483)
+++ trunk/varnish-cache/bin/varnishd/cache_pass.c	2006-07-18 10:32:40 UTC (rev 484)
@@ -17,6 +17,7 @@
 #include "shmlog.h"
 #include "cache.h"
 
+#define			PASS_BUFSIZ		8192
 
 /*--------------------------------------------------------------------*/
 
@@ -27,12 +28,12 @@
 	char *b, *e;
 	off_t	cl;
 	unsigned c;
-	char buf[BUFSIZ];
+	char buf[PASS_BUFSIZ];
 
 	if (bi != NULL)
 		cl = strtoumax(bi, NULL, 0);
 	else
-		cl = (1<<30);		/* XXX */
+		cl = (1 << 30);
 
 	i = fcntl(fd, F_GETFL);		/* XXX ? */
 	i &= ~O_NONBLOCK;
@@ -69,7 +70,7 @@
 	char *b, *q, *e;
 	char *p;
 	unsigned u;
-	char buf[BUFSIZ];
+	char buf[PASS_BUFSIZ];
 	char *bp, *be;
 
 	i = fcntl(fd, F_GETFL);		/* XXX ? */
@@ -159,6 +160,8 @@
 	assert(vc != NULL);
 
 	http_BuildSbuf(sp->fd, Build_Reply, w->sb, hp);
+	sbuf_cat(w->sb, "\r\n");
+	sbuf_finish(w->sb);
 	vca_write(sp, sbuf_data(w->sb), sbuf_len(w->sb));
 
 	if (http_GetHdr(hp, "Content-Length", &b))




More information about the varnish-commit mailing list