<div dir="ltr">Nice, thanks!<div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 30, 2016 at 2:51 AM, Stuart Douglas <span dir="ltr"><<a href="mailto:sdouglas@redhat.com" target="_blank">sdouglas@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><a href="https://issues.jboss.org/browse/UNDERTOW-810" rel="noreferrer" target="_blank">https://issues.jboss.org/<wbr>browse/UNDERTOW-810</a><br>
<br>
I have fixed this upstream.<br>
<br>
Stuart<br>
<div><div class="h5"><br>
On Mon, Aug 29, 2016 at 5:19 PM, Martin Andersson<br>
<<a href="mailto:martin.andersson@purplescout.se">martin.andersson@purplescout.<wbr>se</a>> wrote:<br>
> Hi all,<br>
><br>
> I've seem to have hit a bug in undertow when combining proxying and gzip.<br>
><br>
> I'm trying to use undertow as a reverse-proxy and also compressing the<br>
> result when clients support it. Undertow-code below.<br>
><br>
> * Proxying without compressing works fine (curl -v localhost:8099/proxy)<br>
> * Compressing content that is not proxied works fine (curl -v --compress<br>
> localhost:8099/local)<br>
> * Proxy and compression just hangs. Not even headers are received (curl -v<br>
> --compress localhost:8099/proxy)<br>
><br>
> Trying to debug what's going on I found that the GzipStreamSinkConduit<br>
> receives all content but is never flushed.<br>
><br>
> The call sequence for GzipStreamSinkConduit for proxied content is:<br>
> write(ByteBuffer src) - all context from the proxied app is written.<br>
> wakeupWrites() - which basically does nothing. Ends up in<br>
> DeflatingStreamSinkConduit.<wbr>queueWriteListener() which calls any<br>
> WriteReadyHandlers but there are none.<br>
><br>
> Any clues?<br>
><br>
> My code to setup undertow:<br>
><br>
> final PathHandler pathHandler = Handlers.path();<br>
> pathHandler.addExactPath("/<wbr>local", new HttpHandler() {<br>
> @Override<br>
> public void handleRequest(<wbr>HttpServerExchange exchange) throws Exception {<br>
> exchange.getResponseHeaders().<wbr>put(Headers.CONTENT_TYPE, "text/plain");<br>
> exchange.getResponseSender().<wbr>send("Hello World"); }<br>
> });<br>
> pathHandler.addPrefixPath("/<wbr>proxy",<br>
> new ProxyHandler(<br>
> new SimpleProxyClientProvider(new URI("<a href="http://localhost:8060/menu" rel="noreferrer" target="_blank">http://localhost:8060/<wbr>menu</a>")),<br>
> ResponseCodeHandler.HANDLE_<wbr>404));<br>
><br>
> final EncodingHandler handler =<br>
> new EncodingHandler(pathHandler, new ContentEncodingRepository()<br>
> .addEncodingHandler("gzip",<br>
> new GzipEncodingProvider(), 50,<br>
> Predicates.truePredicate()));<br>
><br>
> Undertow.builder()<br>
> .addHttpListener(8099, "0.0.0.0")<br>
> .setHandler(handler)<br>
> .build().start();<br>
><br>
> --<br>
> Br,<br>
> Martin Andersson<br>
> Purple Scout AB<br>
> +46 732 05 14 01<br>
><br>
</div></div>> ______________________________<wbr>_________________<br>
> undertow-dev mailing list<br>
> <a href="mailto:undertow-dev@lists.jboss.org">undertow-dev@lists.jboss.org</a><br>
> <a href="https://lists.jboss.org/mailman/listinfo/undertow-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/<wbr>mailman/listinfo/undertow-dev</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Br,<div>Martin Andersson</div><div>Purple Scout AB</div><div>+46 732 05 14 01</div></div></div>
</div></div>