[master] 8d1d603 If we call VGZ_Gzip() with flags different from VGZ_NORMAL and it fills the output buffer, we have to call it again with same flags and more output space. (see somewhere in vgz.h)
Poul-Henning Kamp
phk at varnish-cache.org
Thu Jan 27 19:19:31 CET 2011
commit 8d1d603dd686878e4a54c55b876cead575b1e402
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Thu Jan 27 18:18:15 2011 +0000
If we call VGZ_Gzip() with flags different from VGZ_NORMAL and it
fills the output buffer, we have to call it again with same flags
and more output space. (see somewhere in vgz.h)
diff --git a/bin/varnishd/cache_esi_fetch.c b/bin/varnishd/cache_esi_fetch.c
index ff36f28..9369d0a 100644
--- a/bin/varnishd/cache_esi_fetch.c
+++ b/bin/varnishd/cache_esi_fetch.c
@@ -193,7 +193,8 @@ vfp_vep_callback(const struct sess *sp, ssize_t l, enum vgz_flag flg)
i = VGZ_Gzip(vef->vgz, &dp, &dl, flg);
vef->tot += dl;
sp->obj->len += dl;
- } while (!VGZ_IbufEmpty(vef->vgz));
+ } while (!VGZ_IbufEmpty(vef->vgz) ||
+ (flg != VGZ_NORMAL && VGZ_ObufFull(vef->vgz)));
if (px != 0) {
memmove(vef->pending, vef->pending + px,
vef->npend - px);
@@ -283,7 +284,8 @@ vfp_esi_bytes_gg(struct sess *sp, struct http_conn *htc, size_t bytes)
if (vef->bufp < ibuf2 + dl) {
dl = (ibuf2 + dl) - vef->bufp;
assert(dl + vef->npend < sizeof vef->pending);
- memmove(vef->pending + vef->npend, vef->bufp, dl);
+ memmove(vef->pending + vef->npend,
+ vef->bufp, dl);
vef->npend += dl;
}
} while (!VGZ_IbufEmpty(sp->wrk->vgz_rx));
More information about the varnish-commit
mailing list