ARTEMIS-3449: add some additional guarding following behaviour seen prior to ARTEMIS 3465 fix

This commit is contained in:
Robbie Gemmell 2021-09-10 11:41:21 +01:00
parent 6f2d58f886
commit 55fb9bb540
1 changed files with 6 additions and 2 deletions

View File

@ -678,11 +678,15 @@ public class ProtonServerSenderContext extends ProtonInitializable implements Pr
if (writableBytes != 0) {
final int writtenBytes = frameBuffer.writerIndex();
readSize = context.readInto(frameBuffer.internalNioBuffer(writtenBytes, writableBytes));
frameBuffer.writerIndex(writtenBytes + readSize);
if (readSize > 0) {
frameBuffer.writerIndex(writtenBytes + readSize);
}
}
sender.send(new NettyReadable(frameBuffer));
position += readSize;
if (readSize > 0) {
position += readSize;
}
connection.instantFlush();
return true;
}