rp.setStage(org.apache.coyote.Constants.STAGE_KEEPALIVE);
- if (!error && keepAlive && !comet) {
- //we're at a keep alive stage,
- openSocket = true;
- //Add the socket to the poller
- socket.getPoller().add(socket);
- //free up the thread
- break;
- }
+// if (!error && keepAlive && !comet) {
+// //we're at a keep alive stage,
+// openSocket = true;
+// //Add the socket to the poller
+// socket.getPoller().add(socket);
+// //free up the thread
+// break;
+// }
}
rp.setStage(org.apache.coyote.Constants.STAGE_ENDED);
workers.notify();
}
}
- /**
- * Process given socket.
- */
- protected boolean processSocket(NioChannel socket) {
- return processSocket(socket,null);
- }
/**
* Process given socket for an event.
*/
- protected boolean processSocket(NioChannel socket, SocketStatus status) {
- return processSocket(socket,status,true);
- }
-
protected boolean processSocket(NioChannel socket, SocketStatus status, boolean dispatch) {
try {
if (executor == null) {
//check if thread is available
if ( isWorkerAvailable() ) {
unreg(sk, attachment);
- if (!processSocket(channel, SocketStatus.OPEN))
- processSocket(channel, SocketStatus.DISCONNECT);
+ if (!processSocket(channel, SocketStatus.OPEN,true))
+ processSocket(channel, SocketStatus.DISCONNECT,true);
attachment.setFairness(0);
} else {
//increase the fairness counter
//later on, improve latch behavior
if ( isWorkerAvailable() ) {
unreg(sk, attachment);
- boolean close = (!processSocket(channel));
+ boolean close = (!processSocket(channel,null,true));
if (close) {
cancelledKey(sk,SocketStatus.DISCONNECT,false);
}
cancelledKey(key, SocketStatus.ERROR,false);
}
}//for
- if ( log.isDebugEnabled() ) log.debug("Poller processed "+keycount+" keys through timeout");
}
}
} finally {
//dereference socket to let GC do its job
socket = null;
+ this.socket = null;
+ key = null;
// Finish up this request
recycleWorkerThread(this);
}