mirror of
https://github.com/corda/corda.git
synced 2025-01-17 02:09:50 +00:00
Fix an off-by-one error when EOS is hit on the socket
This commit is contained in:
parent
19b6e11cbc
commit
35a96a0d36
@ -47,7 +47,9 @@ public class SocketChannel extends SelectableChannel
|
||||
if (! open) return -1;
|
||||
if (b.remaining() == 0) return 0;
|
||||
int r = natRead(socket, b.array(), b.arrayOffset() + b.position(), b.remaining());
|
||||
b.position(b.position() + r);
|
||||
if (r > 0) {
|
||||
b.position(b.position() + r);
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user