Commit 8e19f5ba authored by Tom Evans's avatar Tom Evans

OF-908: Avoid chunked encoding for BOSH

Fixes the alternate (synchronous) write to the HTTP response output
stream.
parent 70de10f8
...@@ -299,9 +299,9 @@ public class HttpBindServlet extends HttpServlet { ...@@ -299,9 +299,9 @@ public class HttpBindServlet extends HttpServlet {
if (async) { if (async) {
response.getOutputStream().setWriteListener(new WriteListenerImpl(context, byteContent)); response.getOutputStream().setWriteListener(new WriteListenerImpl(context, byteContent));
} else { } else {
// BOSH communication should not have Chunked encoding. Ensure that the // BOSH communication should not use Chunked encoding.
// buffer can hold the entire response to prevent chunking. // This is prevented by explicitly setting the Content-Length header.
context.getResponse().setBufferSize(byteContent.length); context.getResponse().setContentLength(byteContent.length);
context.getResponse().getOutputStream().write(byteContent); context.getResponse().getOutputStream().write(byteContent);
context.getResponse().getOutputStream().flush(); context.getResponse().getOutputStream().flush();
context.complete(); context.complete();
......
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