tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1160652 - in /tomcat/trunk/java/org/apache/coyote/ajp: AbstractAjpProcessor.java AjpAprProcessor.java AjpNioProcessor.java AjpProcessor.java
Date Tue, 23 Aug 2011 12:19:20 GMT
Author: markt
Date: Tue Aug 23 12:19:20 2011
New Revision: 1160652

URL: http://svn.apache.org/viewvc?rev=1160652&view=rev
Log:
Pull up finish() so output() is used consistently to wrote closing message

Modified:
    tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java
    tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java
    tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java
    tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java

Modified: tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java?rev=1160652&r1=1160651&r2=1160652&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java Tue Aug 23 12:19:20
2011
@@ -537,7 +537,6 @@ public abstract class AbstractAjpProcess
 
     // Methods called by action()
     protected abstract void actionInternal(ActionCode actionCode, Object param);
-    protected abstract void finish() throws IOException;
 
     // Methods called by prepareResponse()
     protected abstract void output(byte[] src, int offset, int length)
@@ -939,6 +938,35 @@ public abstract class AbstractAjpProcess
     }
 
 
+    /**
+     * Finish AJP response.
+     */
+    protected void finish() throws IOException {
+
+        if (!response.isCommitted()) {
+            // Validate and write response headers
+            try {
+                prepareResponse();
+            } catch (IOException e) {
+                // Set error flag
+                error = true;
+            }
+        }
+
+        if (finished)
+            return;
+
+        finished = true;
+
+        // Add the end message
+        if (error) {
+            output(endAndCloseMessageArray, 0, endAndCloseMessageArray.length);
+        } else {
+            output(endMessageArray, 0, endMessageArray.length);
+        }
+    }
+
+
     // ------------------------------------- InputStreamInputBuffer Inner Class
 
 

Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java?rev=1160652&r1=1160651&r2=1160652&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java Tue Aug 23 12:19:20 2011
@@ -282,43 +282,6 @@ public class AjpAprProcessor extends Abs
 
 
     /**
-     * Finish AJP response.
-     */
-    @Override
-    protected void finish() throws IOException {
-
-        if (!response.isCommitted()) {
-            // Validate and write response headers
-            try {
-                prepareResponse();
-            } catch (IOException e) {
-                // Set error flag
-                error = true;
-            }
-        }
-
-        if (finished)
-            return;
-
-        finished = true;
-
-        // Add the end message
-        byte[] messageArray;
-        if (error) {
-            messageArray = endAndCloseMessageArray;
-        } else {
-            messageArray = endMessageArray;
-        }
-        if (outputBuffer.position() + messageArray.length > outputBuffer.capacity()) {
-            flush(false);
-        }
-        outputBuffer.put(messageArray);
-        flush(false);
-
-    }
-
-
-    /**
      * Read at least the specified amount of bytes, and place them
      * in the input buffer.
      */

Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java?rev=1160652&r1=1160651&r2=1160652&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java Tue Aug 23 12:19:20 2011
@@ -292,37 +292,6 @@ public class AjpNioProcessor extends Abs
         writeBuffer.clear();
     }
 
-    /**
-     * Finish AJP response.
-     */
-    @Override
-    protected void finish() throws IOException {
-
-        if (!response.isCommitted()) {
-            // Validate and write response headers
-            try {
-                prepareResponse();
-            } catch (IOException e) {
-                // Set error flag
-                error = true;
-            }
-        }
-
-        if (finished)
-            return;
-
-        finished = true;
-
-        // Add the end message
-        byte[] messageArray;
-        if (error) {
-            messageArray = endAndCloseMessageArray;
-        } else {
-            messageArray = endMessageArray;
-        }
-        output(messageArray, 0, messageArray.length);
-    }
-
 
     /**
      * Read the specified amount of bytes, and place them in the input buffer.

Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java?rev=1160652&r1=1160651&r2=1160652&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java Tue Aug 23 12:19:20 2011
@@ -287,32 +287,6 @@ public class AjpProcessor extends Abstra
         output.write(src, offset, length);
     }
 
-    /**
-     * Finish AJP response.
-     */
-    @Override
-    protected void finish() throws IOException {
-
-        if (!response.isCommitted()) {
-            // Validate and write response headers
-            try {
-                prepareResponse();
-            } catch (IOException e) {
-                // Set error flag
-                error = true;
-            }
-        }
-
-        if (finished)
-            return;
-
-        finished = true;
-
-        // Add the end message
-        output.write(error ? endAndCloseMessageArray : endMessageArray);
-
-    }
-
 
     /**
      * Read at least the specified amount of bytes, and place them



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message