Fix an infinite loop in CompositeChannelBuffer.setBytes()
.. which occurs when a channel is closed during I/O
This commit is contained in:
parent
c059d13108
commit
cb2b2830b2
@ -508,6 +508,13 @@ public class CompositeChannelBuffer extends AbstractChannelBuffer {
|
||||
int localLength = Math.min(length, s.capacity() - (index - adjustment));
|
||||
int localReadBytes = s.setBytes(index - adjustment, in, localLength);
|
||||
|
||||
if (localReadBytes <= 0) {
|
||||
if (readBytes == 0) {
|
||||
readBytes = localReadBytes;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (localReadBytes == localLength) {
|
||||
index += localLength;
|
||||
length -= localLength;
|
||||
|
Loading…
x
Reference in New Issue
Block a user