tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rj...@apache.org
Subject svn commit: r1175594 - in /tomcat/trunk/java/org/apache/coyote/ajp: AjpAprProcessor.java AjpNioProcessor.java AjpProcessor.java
Date Sun, 25 Sep 2011 21:54:13 GMT
Author: rjung
Date: Sun Sep 25 21:54:13 2011
New Revision: 1175594

URL: http://svn.apache.org/viewvc?rev=1175594&view=rev
Log:
Don't send 503 if endpoint is paused and we
just answered an AJP CPING.

If CPING works, mod_jk expects the main request
to work too. If we don't want to process the
main request we need to fail the CPING received
directly before.

Modified:
    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/AjpAprProcessor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java?rev=1175594&r1=1175593&r2=1175594&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java Sun Sep 25 21:54:13 2011
@@ -113,6 +113,7 @@ public class AjpAprProcessor extends Abs
         long socketRef = socket.getSocket().longValue();
         Socket.setrbb(socketRef, inputBuffer);
         Socket.setsbb(socketRef, outputBuffer);
+        boolean cping = false;
 
         // Error flag
         error = false;
@@ -137,6 +138,7 @@ public class AjpAprProcessor extends Abs
                         recycle(true);
                         break;
                     }
+                    cping = true;
                     if (Socket.send(socketRef, pongMessageArray, 0,
                             pongMessageArray.length) < 0) {
                         error = true;
@@ -180,12 +182,13 @@ public class AjpAprProcessor extends Abs
                 }
             }
 
-            if (endpoint.isPaused()) {
+            if (!cping && endpoint.isPaused()) {
                 // 503 - Service unavailable
                 response.setStatus(503);
                 adapter.log(request, response, 0);
                 error = true;
             }
+            cping = false;
 
             // Process the request in the adapter
             if (!error) {

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=1175594&r1=1175593&r2=1175594&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java Sun Sep 25 21:54:13 2011
@@ -98,6 +98,7 @@ public class AjpNioProcessor extends Abs
         this.socket = socket.getSocket();
         
         long soTimeout = endpoint.getSoTimeout();
+        boolean cping = false;
 
         // Error flag
         error = false;
@@ -122,6 +123,7 @@ public class AjpNioProcessor extends Abs
                         recycle(true);
                         break;
                     }
+                    cping = true;
                     try {
                         output(pongMessageArray, 0, pongMessageArray.length);
                     } catch (IOException e) {
@@ -167,12 +169,13 @@ public class AjpNioProcessor extends Abs
                 }
             }
 
-            if (endpoint.isPaused()) {
+            if (!cping && endpoint.isPaused()) {
                 // 503 - Service unavailable
                 response.setStatus(503);
                 adapter.log(request, response, 0);
                 error = true;
             }
+            cping = false;
 
             // Process the request in the adapter
             if (!error) {

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=1175594&r1=1175593&r2=1175594&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java Sun Sep 25 21:54:13 2011
@@ -111,6 +111,7 @@ public class AjpProcessor extends Abstra
         if (keepAliveTimeout > 0) {
             soTimeout = socket.getSocket().getSoTimeout();
         }
+        boolean cping = false;
 
         // Error flag
         error = false;
@@ -140,6 +141,7 @@ public class AjpProcessor extends Abstra
                         recycle(true);
                         break;
                     }
+                    cping = true;
                     try {
                         output.write(pongMessageArray);
                     } catch (IOException e) {
@@ -183,12 +185,13 @@ public class AjpProcessor extends Abstra
                 }
             }
 
-            if (endpoint.isPaused()) {
+            if (!cping && endpoint.isPaused()) {
                 // 503 - Service unavailable
                 response.setStatus(503);
                 adapter.log(request, response, 0);
                 error = true;
             }
+            cping = false;
 
             // Process the request in the adapter
             if (!error) {



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


Mime
View raw message