Hi,
I'm using WriteListener to send data from a Jetty 9.2.9 based Servlet in a
response. Chunked encoding must be prevented. To do so, the buffer size of
the response is set to match the length of the data. This appears to work
for smaller packets, but larger packets (larger dan 20-something kilobytes)
cause chunked encoding to re-appear. How do I prevent this?
static class WriteListenerImpl implements WriteListener {
private final AsyncContext context;
private final byte[] data;
public WriteListenerImpl(AsyncContext context, byte[] data) {
this.context = context;
this.data = data;
}
@Override
public void onWritePossible() throws IOException {
context.getResponse().setBufferSize(data.length);
context.getResponse().getOutputStream().write(data);
context.complete();
}
}
Kind regards,
Guus
_______________________________________________
jetty-users mailing list
[email protected]
To change your delivery options, retrieve your password, or unsubscribe from
this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users