[#670] Intermittent IllegalStateException with ByteToMessageDecoder impl with bounded inbound buffer
* Ensure to call discardReadBytes() before giving up expanding the buffer
This commit is contained in:
parent
d9d8acf331
commit
ae839db383
@ -192,6 +192,7 @@ public class AioSocketChannel extends AbstractAioChannel implements SocketChanne
|
|||||||
|
|
||||||
final int maxCapacity = byteBuf.maxCapacity();
|
final int maxCapacity = byteBuf.maxCapacity();
|
||||||
if (capacity == maxCapacity) {
|
if (capacity == maxCapacity) {
|
||||||
|
byteBuf.discardReadBytes();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -141,6 +141,10 @@ abstract class AbstractNioByteChannel extends AbstractNioChannel {
|
|||||||
|
|
||||||
final int maxCapacity = byteBuf.maxCapacity();
|
final int maxCapacity = byteBuf.maxCapacity();
|
||||||
if (capacity == maxCapacity) {
|
if (capacity == maxCapacity) {
|
||||||
|
if (byteBuf.readerIndex() != 0) {
|
||||||
|
byteBuf.discardReadBytes();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user