<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">&lt;<a href="mailto:sdouglas@redhat.com" target="_blank">sdouglas@redhat.com</a>&gt;</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>
&lt;<a href="mailto:martin.andersson@purplescout.se">martin.andersson@purplescout.<wbr>se</a>&gt; wrote:<br>
&gt; Hi all,<br>
&gt;<br>
&gt; I&#39;ve seem to have hit a bug in undertow when combining proxying and gzip.<br>
&gt;<br>
&gt; I&#39;m trying to use undertow as a reverse-proxy and also compressing the<br>
&gt; result when clients support it. Undertow-code below.<br>
&gt;<br>
&gt; * Proxying without compressing works fine (curl -v localhost:8099/proxy)<br>
&gt; * Compressing content that is not proxied works fine (curl -v --compress<br>
&gt; localhost:8099/local)<br>
&gt; * Proxy and compression just hangs. Not even headers are received (curl -v<br>
&gt; --compress localhost:8099/proxy)<br>
&gt;<br>
&gt; Trying to debug what&#39;s going on I found that the GzipStreamSinkConduit<br>
&gt; receives all content but is never flushed.<br>
&gt;<br>
&gt; The call sequence for GzipStreamSinkConduit for proxied content is:<br>
&gt; write(ByteBuffer src) - all context from the proxied app is written.<br>
&gt; wakeupWrites() - which basically does nothing. Ends up in<br>
&gt; DeflatingStreamSinkConduit.<wbr>queueWriteListener() which calls any<br>
&gt; WriteReadyHandlers but there are none.<br>
&gt;<br>
&gt; Any clues?<br>
&gt;<br>
&gt; My code to setup undertow:<br>
&gt;<br>
&gt; final PathHandler pathHandler = Handlers.path();<br>
&gt; pathHandler.addExactPath(&quot;/<wbr>local&quot;, new HttpHandler() {<br>
&gt; @Override<br>
&gt; public void handleRequest(<wbr>HttpServerExchange exchange) throws Exception {<br>
&gt; exchange.getResponseHeaders().<wbr>put(Headers.CONTENT_TYPE, &quot;text/plain&quot;);<br>
&gt; exchange.getResponseSender().<wbr>send(&quot;Hello World&quot;); }<br>
&gt; });<br>
&gt; pathHandler.addPrefixPath(&quot;/<wbr>proxy&quot;,<br>
&gt; new ProxyHandler(<br>
&gt; new SimpleProxyClientProvider(new URI(&quot;<a href="http://localhost:8060/menu" rel="noreferrer" target="_blank">http://localhost:8060/<wbr>menu</a>&quot;)),<br>
&gt; ResponseCodeHandler.HANDLE_<wbr>404));<br>
&gt;<br>
&gt; final EncodingHandler handler =<br>
&gt; new EncodingHandler(pathHandler, new ContentEncodingRepository()<br>
&gt;  .addEncodingHandler(&quot;gzip&quot;,<br>
&gt;  new GzipEncodingProvider(), 50,<br>
&gt; Predicates.truePredicate()));<br>
&gt;<br>
&gt; Undertow.builder()<br>
&gt; .addHttpListener(8099, &quot;0.0.0.0&quot;)<br>
&gt; .setHandler(handler)<br>
&gt; .build().start();<br>
&gt;<br>
&gt; --<br>
&gt; Br,<br>
&gt; Martin Andersson<br>
&gt; Purple Scout AB<br>
&gt; +46 732 05 14 01<br>
&gt;<br>
</div></div>&gt; ______________________________<wbr>_________________<br>
&gt; undertow-dev mailing list<br>
&gt; <a href="mailto:undertow-dev@lists.jboss.org">undertow-dev@lists.jboss.org</a><br>
&gt; <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>