From: phk Date: Tue, 18 Jul 2006 10:32:40 +0000 (+0000) Subject: Use bigger buffersizes for pass mode X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2acda8d38cd6f54025a3af365ead554b0e4cdb15;p=varnish Use bigger buffersizes for pass mode Terminate the sbuf with the reply headers properly. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@484 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishd/cache_pass.c b/varnish-cache/bin/varnishd/cache_pass.c index d3e37e5c..d5c92129 100644 --- a/varnish-cache/bin/varnishd/cache_pass.c +++ b/varnish-cache/bin/varnishd/cache_pass.c @@ -17,6 +17,7 @@ #include "shmlog.h" #include "cache.h" +#define PASS_BUFSIZ 8192 /*--------------------------------------------------------------------*/ @@ -27,12 +28,12 @@ pass_straight(struct sess *sp, int fd, struct http *hp, char *bi) 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 @@ pass_chunked(struct sess *sp, int fd, struct http *hp) 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 @@ PassBody(struct worker *w, struct sess *sp) 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))