Author: remy.maucherat(a)jboss.com
Date: 2014-08-26 02:56:30 -0400 (Tue, 26 Aug 2014)
New Revision: 2493
Modified:
branches/7.5.x/src/main/java/org/apache/coyote/http11/InternalNioOutputBuffer.java
Log:
JBWEB-302: Make sure buffer state is right after sending an ack (and also add a loop to
make sure everything is always written). Submitted by Aaron Ogburn.
Modified:
branches/7.5.x/src/main/java/org/apache/coyote/http11/InternalNioOutputBuffer.java
===================================================================
---
branches/7.5.x/src/main/java/org/apache/coyote/http11/InternalNioOutputBuffer.java 2014-08-20
12:58:33 UTC (rev 2492)
+++
branches/7.5.x/src/main/java/org/apache/coyote/http11/InternalNioOutputBuffer.java 2014-08-26
06:56:30 UTC (rev 2493)
@@ -345,11 +345,14 @@
public void sendAck() throws Exception {
if (!committed) {
- this.bbuf.clear();
- this.bbuf.put(Constants.ACK_BYTES).flip();
- if (this.write(writeTimeout, TimeUnit.MILLISECONDS) < 0) {
- throw new IOException(MESSAGES.failedWrite());
- }
+ bbuf.clear();
+ bbuf.put(Constants.ACK_BYTES).flip();
+ while (bbuf.hasRemaining()) {
+ if (blockingWrite(writeTimeout, TimeUnit.MILLISECONDS) < 0) {
+ throw new IOException(MESSAGES.failedWrite());
+ }
+ }
+ bbuf.clear();
}
}
Show replies by date