ngrok / ngrok-java

Embed ngrok secure ingress into your Java apps with a single line of code.
Other
21 stars 6 forks source link

`ConnectionOutputStream.write` throws exception if called with sufficiently large payload #5

Closed nikolay-ngrok closed 12 months ago

nikolay-ngrok commented 1 year ago

Results in the following:

java.nio.BufferOverflowException
    at java.base/java.nio.ByteBuffer.put(ByteBuffer.java:1189)
    at com.ngrok.net.ConnectionOutputStream.write(ConnectionOutputStream.java:27)
...

Instead of throwing an exception, it should chunk the payload based on the internal buffer size (currently set to 1024 bytes). We should also increase the buffer size to 4k.