tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1160639 - in /tomcat/trunk/java/org/apache/coyote/ajp: AbstractAjpProcessor.java AjpAprProcessor.java AjpNioProcessor.java AjpProcessor.java
Date Tue, 23 Aug 2011 11:40:06 GMT
Author: markt
Date: Tue Aug 23 11:40:05 2011
New Revision: 1160639

URL: http://svn.apache.org/viewvc?rev=1160639&view=rev
Log:
Pull up flush()
APR (like BIO and NIO) now writes each AJP packet to the socket as soon as it is ready

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=1160639&r1=1160638&r2=1160639&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java Tue Aug 23 11:40:05
2011
@@ -537,7 +537,6 @@ public abstract class AbstractAjpProcess
 
     // Methods called by action()
     protected abstract void actionInternal(ActionCode actionCode, Object param);
-    protected abstract void flush(boolean tbd) throws IOException;
     protected abstract void finish() throws IOException;
 
     // Methods called by prepareResponse()
@@ -557,6 +556,17 @@ public abstract class AbstractAjpProcess
 
 
     /**
+     * Callback to write data from the buffer.
+     */
+    protected void flush(boolean explicit) throws IOException {
+        if (explicit && !finished) {
+            // Send the flush message
+            output(flushMessageArray, 0, flushMessageArray.length);
+        }
+    }
+
+    
+    /**
      * After reading the request headers, we have to setup the request filters.
      */
     protected void prepareRequest() {

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=1160639&r1=1160638&r2=1160639&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java Tue Aug 23 11:40:05 2011
@@ -269,6 +269,15 @@ public class AjpAprProcessor extends Abs
     protected void output(byte[] src, int offset, int length)
             throws IOException {
         outputBuffer.put(src, offset, length);
+        
+        long socketRef = socket.getSocket().longValue();
+        
+        if (outputBuffer.position() > 0) {
+            if ((socketRef != 0) && Socket.sendbb(socketRef, 0, outputBuffer.position())
< 0) {
+                throw new IOException(sm.getString("ajpprocessor.failedsend"));
+            }
+            outputBuffer.clear();
+        }
     }
 
 
@@ -497,28 +506,4 @@ public class AjpAprProcessor extends Abs
         outputBuffer.clear();
 
     }
-
-
-    /**
-     * Callback to write data from the buffer.
-     */
-    @Override
-    protected void flush(boolean explicit) throws IOException {
-        
-        long socketRef = socket.getSocket().longValue();
-        
-        if (outputBuffer.position() > 0) {
-            if ((socketRef != 0) && Socket.sendbb(socketRef, 0, outputBuffer.position())
< 0) {
-                throw new IOException(sm.getString("ajpprocessor.failedsend"));
-            }
-            outputBuffer.clear();
-        }
-        // Send explicit flush message
-        if (explicit && !finished &&  (socketRef != 0)) {
-            if (Socket.send(socketRef, flushMessageArray, 0,
-                    flushMessageArray.length) < 0) {
-                throw new IOException(sm.getString("ajpprocessor.failedflush"));
-            }
-        }
-    }
 }

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=1160639&r1=1160638&r2=1160639&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java Tue Aug 23 11:40:05 2011
@@ -486,14 +486,4 @@ public class AjpNioProcessor extends Abs
     }
 
 
-    /**
-     * Callback to write data from the buffer.
-     */
-    @Override
-    protected void flush(boolean explicit) throws IOException {
-        if (explicit && !finished) {
-            // Send the flush message
-            output(flushMessageArray, 0, flushMessageArray.length);
-        }
-    }
 }

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=1160639&r1=1160638&r2=1160639&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java Tue Aug 23 11:40:05 2011
@@ -433,16 +433,4 @@ public class AjpProcessor extends Abstra
             return true;
         }
     }
-
-
-    /**
-     * Callback to write data from the buffer.
-     */
-    @Override
-    protected void flush(boolean explicit) throws IOException {
-        if (explicit && !finished) {
-            // Send the flush message
-            output.write(flushMessageArray);
-        }
-    }
 }



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


Mime
View raw message