Skip to content

Commit ae08c06

Browse files
committed
properly handle bufferoverflow
1 parent dde201a commit ae08c06

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

AndroidAsync/src/com/koushikdutta/async/AsyncSSLSocketWrapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public void onDataAvailable(DataEmitter emitter, ByteBufferList bb) {
9292
addToPending(transformed, read);
9393
if (res.getStatus() == Status.BUFFER_OVERFLOW) {
9494
remaining = -1;
95-
read = ByteBufferList.obtain(read.remaining() * 2);
95+
read = ByteBufferList.obtain(read.capacity() * 2);
9696
}
9797
else if (res.getStatus() == Status.BUFFER_UNDERFLOW) {
9898
read = null;

0 commit comments

Comments
 (0)