mirror of
https://github.com/corda/corda.git
synced 2025-01-29 07:34:13 +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 (! open) return -1;
|
||||||
if (b.remaining() == 0) return 0;
|
if (b.remaining() == 0) return 0;
|
||||||
int r = natRead(socket, b.array(), b.arrayOffset() + b.position(), b.remaining());
|
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;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user