Commit 5e1b81af authored by Nils Goroll's avatar Nils Goroll

clear up my confusion

the code is correct in varnish-cache, the VDP_bytes(req, VDP_NULL, ...) calls do not return.

This reverts commit ff7d20a2.
parent 21dd351b
......@@ -105,35 +105,23 @@ vped_pretend_gzip_bytes(struct req *req, enum vdp_action act, void **priv,
while (l > 0) {
if (l >= 65535) {
lx = 65535;
if (VDP_bytes(req, VDP_FLUSH, buf1, sizeof buf1))
if (VDP_bytes(req, VDP_NULL, buf1, sizeof buf1))
return (-1);
} else {
lx = (uint16_t)l;
buf2[0] = 0;
vle16enc(buf2 + 1, lx);
vle16enc(buf2 + 3, ~lx);
if (VDP_bytes(req, VDP_FLUSH, buf2, sizeof buf2))
if (VDP_bytes(req, VDP_NULL, buf2, sizeof buf2))
return (-1);
}
if (VDP_bytes(req, VDP_FLUSH, p, lx))
if (VDP_bytes(req, VDP_NULL, p, lx))
return (-1);
l -= lx;
p += lx;
}
/*
* https://github.com/varnishcache/varnish-cache/issues/3028
*
* the original code has VDP_NULL above, and this flush from below, how
* can this possibly work? who guarantees that our stackframe is still
* intact when we get called the next time?
*
* XXX revisit
*/
#ifdef ORIGINAL_CODE
/* buf1 & buf2 is local, have to flush */
//return (VDP_bytes(req, VDP_FLUSH, NULL, 0));
#endif
return (0);
return (VDP_bytes(req, VDP_FLUSH, NULL, 0));
}
const struct vdp vped_pretend_gz = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment