-
Enhancement
-
Resolution: Done
-
Major
-
2.2.19.Final
-
None
After a channel.write(buffer), the implementation checks only buffer.hasRemaining, not the result of channel.write. We should write until a write returns zero. In synthetic benchmarks this seems to result in a significant performance improvement.
UndertowOutputStream:
https://github.com/undertow-io/undertow/blob/a3aebce60e57f83b02aa847c50d6e372b9a9b9b5/core/src/main/java/io/undertow/io/UndertowOutputStream.java#L294-L301
while (buffer.hasRemaining()) { if(writeFinal) { channel.writeFinal(buffer); } else { channel.write(buffer); } if(buffer.hasRemaining()) { channel.awaitWritable(); } }
ServletOutputStreamImpl:
https://github.com/undertow-io/undertow/blob/fde1ca6ffc8c6248a62179e98c59eb09202545c5/servlet/src/main/java/io/undertow/servlet/spec/ServletOutputStreamImpl.java#L581-L589
while (buffer.hasRemaining()) { if (writeFinal) { channel.writeFinal(buffer); } else { channel.write(buffer); } if (buffer.hasRemaining()) { channel.awaitWritable(); } }
- is incorporated by
-
WFCORE-6057 Upgrade Undertow to 2.3.0.Final (CVE-2022-2764)
- Closed
-
WFLY-17017 Upgrade Undertow to 2.3.0.Beta1
- Closed
-
WFCORE-6056 Upgrade Undertow to 2.3.0.Beta1
- Closed
-
WFLY-17107 Upgrade Undertow legacy to 2.2.20.Final
- Closed