tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject svn commit: r525160 - /tomcat/tc6.0.x/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java
Date Tue, 03 Apr 2007 14:13:34 GMT
Author: remm
Date: Tue Apr  3 07:13:33 2007
New Revision: 525160

URL: http://svn.apache.org/viewvc?view=rev&rev=525160
Log:
- It should be possible for the event object to be closed asynchronously. In that case, I
think an END event
  should be sent to cleanup the pipeline.

Modified:
    tomcat/tc6.0.x/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java

Modified: tomcat/tc6.0.x/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java?view=diff&rev=525160&r1=525159&r2=525160
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java (original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java Tue Apr  3
07:13:33 2007
@@ -120,8 +120,15 @@
             boolean error = false;
             try {
                 if (status == SocketStatus.OPEN) {
-                    request.getEvent().setEventType(CometEvent.EventType.READ);
-                    request.getEvent().setEventSubType(null);
+                    if (response.isClosed()) {
+                        // The event has been closed asynchronously, so call end instead
of
+                        // read to cleanup the pipeline
+                        request.getEvent().setEventType(CometEvent.EventType.END);
+                        request.getEvent().setEventSubType(null);
+                    } else {
+                        request.getEvent().setEventType(CometEvent.EventType.READ);
+                        request.getEvent().setEventSubType(null);
+                    }
                 } else if (status == SocketStatus.DISCONNECT) {
                     request.getEvent().setEventType(CometEvent.EventType.ERROR);
                     request.getEvent().setEventSubType(CometEvent.EventSubType.CLIENT_DISCONNECT);
@@ -134,8 +141,15 @@
                     request.getEvent().setEventType(CometEvent.EventType.END);
                     request.getEvent().setEventSubType(CometEvent.EventSubType.SERVER_SHUTDOWN);
                 } else if (status == SocketStatus.TIMEOUT) {
-                    request.getEvent().setEventType(CometEvent.EventType.ERROR);
-                    request.getEvent().setEventSubType(CometEvent.EventSubType.TIMEOUT);
+                    if (response.isClosed()) {
+                        // The event has been closed asynchronously, so call end instead
of
+                        // read to cleanup the pipeline
+                        request.getEvent().setEventType(CometEvent.EventType.END);
+                        request.getEvent().setEventSubType(null);
+                    } else {
+                        request.getEvent().setEventType(CometEvent.EventType.ERROR);
+                        request.getEvent().setEventSubType(CometEvent.EventSubType.TIMEOUT);
+                    }
                 }
                 
                 // Calling the container



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


Mime
View raw message