Browse Source

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.
pull/1400/head
Violeta Georgieva 8 years ago
parent
commit
23a052c160
  1. 1
      spring-web/src/main/java/org/springframework/http/server/reactive/UndertowServerHttpRequest.java

1
spring-web/src/main/java/org/springframework/http/server/reactive/UndertowServerHttpRequest.java

@ -146,6 +146,7 @@ public class UndertowServerHttpRequest extends AbstractServerHttpRequest { @@ -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);

Loading…
Cancel
Save