Skip to content

Commit 60ddba3

Browse files
committed
Fix a bug ChannelBufferInput#next blocks until the buffer is filled
1 parent 7a2a367 commit 60ddba3

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

msgpack-core/src/main/java/org/msgpack/core/buffer/ChannelBufferInput.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,9 @@ public MessageBuffer next()
6262
throws IOException
6363
{
6464
ByteBuffer b = buffer.sliceAsByteBuffer();
65-
while (b.remaining() > 0) {
66-
int ret = channel.read(b);
67-
if (ret == -1) {
68-
break;
69-
}
65+
int ret = channel.read(b);
66+
if (ret == -1) {
67+
return null;
7068
}
7169
b.flip();
7270
return b.remaining() == 0 ? null : buffer.slice(0, b.limit());

0 commit comments

Comments
 (0)