You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2013/08/31 01:32:05 UTC
svn commit: r1519121 -
/tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java
Author: markt
Date: Fri Aug 30 23:32:05 2013
New Revision: 1519121
URL: http://svn.apache.org/r1519121
Log:
Use the new method to set socket timeouts
Add support for a separate keepalive timeout
Modified:
tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.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=1519121&r1=1519120&r2=1519121&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java Fri Aug 30 23:32:05 2013
@@ -104,9 +104,12 @@ public class AjpAprProcessor extends Abs
// Setting up the socket
this.socketWrapper = socket;
+
long socketRef = socket.getSocket().longValue();
Socket.setrbb(socketRef, inputBuffer);
Socket.setsbb(socketRef, outputBuffer);
+
+ int soTimeout = endpoint.getSoTimeout();
boolean cping = false;
// Error flag
@@ -124,6 +127,10 @@ public class AjpAprProcessor extends Abs
// and the method should return true
break;
}
+ // Set back timeout if keep alive timeout is enabled
+ if (keepAliveTimeout > 0) {
+ setTimeout(socketWrapper, soTimeout);
+ }
// Check message type, process right away and break if
// not regular request processing
int type = requestHeaderMessage.getByte();
@@ -223,6 +230,11 @@ public class AjpAprProcessor extends Abs
request.updateCounters();
rp.setStage(org.apache.coyote.Constants.STAGE_KEEPALIVE);
+ // Set keep alive timeout if enabled
+ if (keepAliveTimeout > 0) {
+ setTimeout(socketWrapper, keepAliveTimeout);
+ }
+
recycle(false);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org