Mailing List Archive

Implementing req.do_gunzip
Hi varnish-dev,

We're currently migrating our vmods from varnish 3, and we have a vmod which
is uncompressing request's body to handle situation where backends are very old
and not able to handle gzip encoding... It happens sometime.

Instead of rewriting this vmod into a V4 module, I was guessing if you see the benefit of integrating into the core instead? It could be done by doing something like

set req.do_gunzip = true;


VTC could be approx..:

$ cat g00008.vtc
varnishtest "test basic gunzip for client request body"

server s1 {
rxreq
expect req.http.content-encoding == <undef>
txresp -status 200
} -start

varnish v1 -cliok "param.set http_gzip_support true" -vcl+backend {
sub vcl_recv {
set req.do_gunzip = true;
}
} -start

client c1 {
txreq -gzipbody {FOOBARFOO}
rxresp
expect resp.status == 200
} -run

varnish v1 -expect n_gzip == 0
varnish v1 -expect n_gunzip == 1


If you think it's interesting and any PR are welcomed, I will be glad to do one.
Else, I will upgrade our VMOD instead :-)

--
Jonathan Huot
Thomson Reuters


________________________________

This e-mail is for the sole use of the intended recipient and contains information that may be privileged and/or confidential. If you are not an intended recipient, please notify the sender by return e-mail and delete this e-mail and any attachments. Certain required legal entity disclosures can be accessed on our website.<http://site.thomsonreuters.com/site/disclosures/>

_______________________________________________
varnish-dev mailing list
varnish-dev@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev
Re: Implementing req.do_gunzip [ In reply to ]
Hi,

Sounds like a good feature and shouldn't be too hard since we already have
the VFPs
That said, if we were to implement it I reckon we should have both
req.do_gunzip and req.do_gzip.

Best.

On Fri, Feb 10, 2017 at 4:33 PM, <jonathan.huot@thomsonreuters.com> wrote:

> Hi varnish-dev,
>
> We're currently migrating our vmods from varnish 3, and we have a vmod
> which
> is uncompressing request's body to handle situation where backends are
> very old
> and not able to handle gzip encoding... It happens sometime.
>
> Instead of rewriting this vmod into a V4 module, I was guessing if you see
> the benefit of integrating into the core instead? It could be done by doing
> something like
>
> set req.do_gunzip = true;
>
>
> VTC could be approx..:
>
> $ cat g00008.vtc
> varnishtest "test basic gunzip for client request body"
>
> server s1 {
> rxreq
> expect req.http.content-encoding == <undef>
> txresp -status 200
> } -start
>
> varnish v1 -cliok "param.set http_gzip_support true" -vcl+backend {
> sub vcl_recv {
> set req.do_gunzip = true;
> }
> } -start
>
> client c1 {
> txreq -gzipbody {FOOBARFOO}
> rxresp
> expect resp.status == 200
> } -run
>
> varnish v1 -expect n_gzip == 0
> varnish v1 -expect n_gunzip == 1
>
>
> If you think it's interesting and any PR are welcomed, I will be glad to
> do one.
> Else, I will upgrade our VMOD instead :-)
>
> --
> Jonathan Huot
> Thomson Reuters
>
>
> ________________________________
>
> This e-mail is for the sole use of the intended recipient and contains
> information that may be privileged and/or confidential. If you are not an
> intended recipient, please notify the sender by return e-mail and delete
> this e-mail and any attachments. Certain required legal entity disclosures
> can be accessed on our website.<http://site.thomsonreuters.com/site/
> disclosures/>
>
> _______________________________________________
> varnish-dev mailing list
> varnish-dev@varnish-cache.org
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev
>
Re: Implementing req.do_gunzip [ In reply to ]
--------
In message <CAJV_h0bR8_3Ws4FPZ-4pdzaM9ak8dZ=jQqD6H13AZNj_ZfyhwA@mail.gmail.com>, Federico Schwindt writes:

>Sounds like a good feature and shouldn't be too hard since we already have
>the VFPs
>That said, if we were to implement it I reckon we should have both
>req.do_gunzip and req.do_gzip.

This ties into the recent chat about filters and bodies in general.


--
Poul-Henning Kamp | UNIX since Zilog Zeus 3.20
phk@FreeBSD.ORG | TCP/IP since RFC 956
FreeBSD committer | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.

_______________________________________________
varnish-dev mailing list
varnish-dev@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev