Make sure flush packet is not send after END_RESPONSE packet. Should handle BZ49929
authormturk <mturk@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 3 Feb 2011 10:23:20 +0000 (10:23 +0000)
committermturk <mturk@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 3 Feb 2011 10:23:20 +0000 (10:23 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1066772 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/coyote/ajp/AjpAprProcessor.java
java/org/apache/coyote/ajp/AjpProcessor.java

index d6926e5..7647620 100644 (file)
@@ -663,7 +663,7 @@ public class AjpAprProcessor extends AbstractAjpProcessor {
             outputBuffer.clear();
         }
         // Send explicit flush message
-        if (explicit) {
+        if (explicit && !finished) {
             if (Socket.sendb(socketRef, flushMessageBuffer, 0,
                     flushMessageBuffer.position()) < 0) {
                 throw new IOException(sm.getString("ajpprocessor.failedflush"));
index 45b2fd8..83afa3d 100644 (file)
@@ -578,8 +578,10 @@ public class AjpProcessor extends AbstractAjpProcessor {
      */
     @Override
     protected void flush(boolean explicit) throws IOException {
-        // Send the flush message
-        output.write(flushMessageArray);
+        if (!finished) {
+            // Send the flush message
+            output.write(flushMessageArray);
+        }
     }