Clear the buffer provided by Undertow before reading the request

When reading more that once for a given request, the position/limit of
the buffer provided by Undertow should be reset in order to use the
full capacity of the buffer.
This commit is contained in:
Violeta Georgieva 2017-04-24 23:14:29 +03:00
parent 8504084553
commit 23a052c160
1 changed files with 1 additions and 0 deletions

View File

@ -146,6 +146,7 @@ public class UndertowServerHttpRequest extends AbstractServerHttpRequest {
this.pooledByteBuffer = this.byteBufferPool.allocate();
}
ByteBuffer byteBuffer = this.pooledByteBuffer.getBuffer();
byteBuffer.clear();
int read = this.channel.read(byteBuffer);
if (logger.isTraceEnabled()) {
logger.trace("read:" + read);