Author: markt
Date: Tue Nov 23 16:57:47 2010
New Revision: 1038202
URL: http://svn.apache.org/viewvc?rev=1038202&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=50207
Modified:
tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java
tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java
tomcat/trunk/webapps/docs/changelog.xml
Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java?rev=1038202&r1=1038201&r2=1038202&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java Tue Nov
23 16:57:47 2010
@@ -329,19 +329,23 @@ public class Http11NioProtocol extends A
if (processor.isAsync()) {
state = processor.asyncPostProcess();
}
- if (state != SocketState.LONG && state !=
SocketState.ASYNC_END) {
+ if (state == SocketState.OPEN || state ==
SocketState.CLOSED) {
release(socket);
if (state == SocketState.OPEN) {
socket.getPoller().add(socket);
}
- } else if (state == SocketState.ASYNC_END) {
- // No further work required
} else if (state == SocketState.LONG) {
- att.setAsync(true); // Re-enable timeouts
+ if (processor.isAsync()) {
+ att.setAsync(true); // Re-enable timeouts
+ } else {
+ // Comet
+ if (log.isDebugEnabled()) log.debug("Keeping
processor["+processor);
+ //add correct poller events here based on Comet
stuff
+ socket.getPoller().add(socket,att.getCometOps());
+ }
} else {
- if (log.isDebugEnabled()) log.debug("Keeping
processor["+processor);
- //add correct poller events here based on Comet stuff
- socket.getPoller().add(socket,att.getCometOps());
+ // state == SocketState.ASYNC_END
+ // No further work required
}
}
}
Modified: tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java?rev=1038202&r1=1038201&r2=1038202&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java Tue Nov 23
16:57:47 2010
@@ -1322,7 +1322,7 @@ public class NioEndpoint extends Abstrac
reg(key,ka,0);//avoid multiple calls, this gets
reregistered after invocation
//if (!processSocket(ka.getChannel(),
SocketStatus.OPEN_CALLBACK)) processSocket(ka.getChannel(),
SocketStatus.DISCONNECT);
if (!processSocket(ka.getChannel(), SocketStatus.OPEN,
true)) processSocket(ka.getChannel(), SocketStatus.DISCONNECT, true);
- }else if ((ka.interestOps()&SelectionKey.OP_READ) ==
SelectionKey.OP_READ ||
+ } else if ((ka.interestOps()&SelectionKey.OP_READ) ==
SelectionKey.OP_READ ||
(ka.interestOps()&SelectionKey.OP_WRITE) ==
SelectionKey.OP_WRITE) {
//only timeout sockets that we are waiting for a read
from
long delta = now - ka.getLastAccess();
@@ -1340,7 +1340,7 @@ public class NioEndpoint extends Abstrac
long nextTime = now+(timeout-delta);
nextExpiration = (nextTime <
nextExpiration)?nextTime:nextExpiration;
}
- }else if (ka.isAsync()) {
+ } else if (ka.isAsync() || ka.getComet()) {
long delta = now - ka.getLastAccess();
long timeout = (ka.getTimeout()==-1)?((long)
socketProperties.getSoTimeout()):(ka.getTimeout());
boolean isTimedout = delta > timeout;
Modified: tomcat/trunk/webapps/docs/changelog.xml
URL:
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1038202&r1=1038201&r2=1038202&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Tue Nov 23 16:57:47 2010
@@ -177,6 +177,10 @@
is configurable with a system property and is <code>8192</code>
by default. (kkolinko)
</add>
+ <fix>
+ <bug>50207</bug>: Ensure Comet timeout events are triggered. This bug
+ was a regression triggered by the fix for <bug>49884</bug>. (markt)
+ </fix>
</changelog>
</subsection>
<subsection name="Jasper">
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]