jersey
jersey copied to clipboard
JdkConnector - BufferOverflow exceptions reading chunked encoding responses
We've found that we can't use jdk-connector to read entities from servers that are using chunked encoding, or we get intermittent BufferOverflow
exceptions. We're fairly sure this only happens with larger files and when accessed via HTTPS, but we've not proved that with complete certainty. We controlled the other endpoint so fixed it by setting the Content-Length
in the response instead.
Found in jersey 2.41
Exception in thread "jdk-connector-14" java.lang.IllegalArgumentException: Buffer overflow
at org.glassfish.jersey.jdk.connector.internal.Utils.appendBuffers(Utils.java:64)
at org.glassfish.jersey.jdk.connector.internal.HttpParser.parse(HttpParser.java:82)
at org.glassfish.jersey.jdk.connector.internal.HttpFilter.processRead(HttpFilter.java:99)
at org.glassfish.jersey.jdk.connector.internal.HttpFilter.processRead(HttpFilter.java:27)
at org.glassfish.jersey.jdk.connector.internal.Filter.onRead(Filter.java:116)
at org.glassfish.jersey.jdk.connector.internal.SslFilter.handleRead(SslFilter.java:361)
at org.glassfish.jersey.jdk.connector.internal.SslFilter.processRead(SslFilter.java:323)
at org.glassfish.jersey.jdk.connector.internal.SslFilter.processRead(SslFilter.java:36)
at org.glassfish.jersey.jdk.connector.internal.Filter.onRead(Filter.java:116)
at org.glassfish.jersey.jdk.connector.internal.Filter.onRead(Filter.java:124)
at org.glassfish.jersey.jdk.connector.internal.TransportFilter$3.completed(TransportFilter.java:262)
I'd love to give you a reproducer/failing test case if you can give me a pointer for how to set up the ReadChunkedEntity
test to use SSL?