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 2011/06/23 01:40:30 UTC
svn commit: r1138694 - in /tomcat/trunk/java/org/apache/coyote/ajp:
AjpNioProcessor.java AjpNioProtocol.java
Author: markt
Date: Wed Jun 22 23:40:30 2011
New Revision: 1138694
URL: http://svn.apache.org/viewvc?rev=1138694&view=rev
Log:
Connector refactoring
SocketWrapper changes for AJP processor
Modified:
tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java
tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProtocol.java
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=1138694&r1=1138693&r2=1138694&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java Wed Jun 22 23:40:30 2011
@@ -39,6 +39,7 @@ import org.apache.tomcat.util.net.NioEnd
import org.apache.tomcat.util.net.NioEndpoint.KeyAttachment;
import org.apache.tomcat.util.net.NioSelectorPool;
import org.apache.tomcat.util.net.SocketStatus;
+import org.apache.tomcat.util.net.SocketWrapper;
/**
@@ -100,13 +101,13 @@ public class AjpNioProcessor extends Abs
*
* @throws IOException error during an I/O operation
*/
- public SocketState process(NioChannel socket)
+ public SocketState process(SocketWrapper<NioChannel> socket)
throws IOException {
RequestInfo rp = request.getRequestProcessor();
rp.setStage(org.apache.coyote.Constants.STAGE_PARSE);
// Setting up the socket
- this.socket = socket;
+ this.socket = socket.getSocket();
long soTimeout = endpoint.getSoTimeout();
int keepAliveTimeout = endpoint.getKeepAliveTimeout();
@@ -114,8 +115,6 @@ public class AjpNioProcessor extends Abs
// Error flag
error = false;
- final KeyAttachment ka = (KeyAttachment)socket.getAttachment(false);
-
while (!error && !endpoint.isPaused()) {
// Parsing the request header
try {
@@ -127,7 +126,7 @@ public class AjpNioProcessor extends Abs
}
// Set back timeout if keep alive timeout is enabled
if (keepAliveTimeout > 0) {
- ka.setTimeout(soTimeout);
+ socket.setTimeout(soTimeout);
}
// Check message type, process right away and break if
// not regular request processing
@@ -224,7 +223,7 @@ public class AjpNioProcessor extends Abs
rp.setStage(org.apache.coyote.Constants.STAGE_KEEPALIVE);
// Set keep alive timeout if enabled
if (keepAliveTimeout > 0) {
- ka.setTimeout(keepAliveTimeout);
+ socket.setTimeout(keepAliveTimeout);
}
recycle();
Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProtocol.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProtocol.java?rev=1138694&r1=1138693&r2=1138694&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProtocol.java Wed Jun 22 23:40:30 2011
@@ -187,7 +187,7 @@ public class AjpNioProtocol extends Abst
if (processor.isAsync() || state == SocketState.ASYNC_END) {
state = processor.asyncDispatch(status);
} else {
- state = processor.process(socket.getSocket());
+ state = processor.process(socket);
}
if (processor.isAsync()) {
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org