Commit 8075aaad authored by Guus der Kinderen's avatar Guus der Kinderen

OF-885: Removed explicit content length as it caused invalid values.

parent cac122f5
...@@ -299,6 +299,9 @@ public class HttpBindServlet extends HttpServlet { ...@@ -299,6 +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
// buffer can hold the entire response to prevent chunking.
context.getResponse().setBufferSize(byteContent.length);
context.getResponse().getOutputStream().write(byteContent); context.getResponse().getOutputStream().write(byteContent);
context.getResponse().getOutputStream().flush(); context.getResponse().getOutputStream().flush();
context.complete(); context.complete();
...@@ -457,10 +460,8 @@ public class HttpBindServlet extends HttpServlet { ...@@ -457,10 +460,8 @@ public class HttpBindServlet extends HttpServlet {
Log.trace("Data can be written to [" + remoteAddress + "]"); Log.trace("Data can be written to [" + remoteAddress + "]");
// BOSH communication should not have Chunked encoding. Ensure that the // BOSH communication should not have Chunked encoding. Ensure that the
// buffer can hold the entire response to prevent chunking. Also explicitly // buffer can hold the entire response to prevent chunking.
// set the content length for the same purpose.
context.getResponse().setBufferSize(data.length); context.getResponse().setBufferSize(data.length);
context.getResponse().setContentLength(data.length);
context.getResponse().getOutputStream().write(data); context.getResponse().getOutputStream().write(data);
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