tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r980260 - /tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java
Date Wed, 28 Jul 2010 22:55:08 GMT
Author: markt
Date: Wed Jul 28 22:55:08 2010
New Revision: 980260

URL: http://svn.apache.org/viewvc?rev=980260&view=rev
Log:
Fix a failing test with the APR connector. Handle async requests that timeout.

Modified:
    tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java?rev=980260&r1=980259&r2=980260&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java Wed Jul 28 22:55:08
2010
@@ -526,39 +526,42 @@ public class Http11AprProtocol implement
             
             SocketState state = SocketState.CLOSED; 
             if (result != null) {
-                // Call the appropriate event
-                try {
-                    state = result.event(status);
-                } catch (java.net.SocketException e) {
-                    // SocketExceptions are normal
-                    Http11AprProtocol.log.debug
-                        (sm.getString
-                            ("http11protocol.proto.socketexception.debug"), e);
-                } catch (java.io.IOException e) {
-                    // IOExceptions are normal
-                    Http11AprProtocol.log.debug
-                        (sm.getString
-                            ("http11protocol.proto.ioexception.debug"), e);
-                }
-                // Future developers: if you discover any other
-                // rare-but-nonfatal exceptions, catch them here, and log as
-                // above.
-                catch (Throwable e) {
-                    // any other exception or error is odd. Here we log it
-                    // with "ERROR" level, so it will show up even on
-                    // less-than-verbose logs.
-                    Http11AprProtocol.log.error
-                        (sm.getString("http11protocol.proto.error"), e);
-                } finally {
-                    if (state != SocketState.LONG) {
-                        connections.remove(Long.valueOf(socket));
-                        recycledProcessors.offer(result);
-                        if (state == SocketState.OPEN) {
-                            proto.endpoint.getPoller().add(socket);
+                if (result.comet) {
+                    // Call the appropriate event
+                    try {
+                        state = result.event(status);
+                    } catch (java.net.SocketException e) {
+                        // SocketExceptions are normal
+                        Http11AprProtocol.log.debug(sm.getString(
+                                "http11protocol.proto.socketexception.debug"),
+                                e);
+                    } catch (java.io.IOException e) {
+                        // IOExceptions are normal
+                        Http11AprProtocol.log.debug(sm.getString(
+                                "http11protocol.proto.ioexception.debug"), e);
+                    }
+                    // Future developers: if you discover any other
+                    // rare-but-nonfatal exceptions, catch them here, and log as
+                    // above.
+                    catch (Throwable e) {
+                        // any other exception or error is odd. Here we log it
+                        // with "ERROR" level, so it will show up even on
+                        // less-than-verbose logs.
+                        Http11AprProtocol.log.error(sm.getString(
+                                "http11protocol.proto.error"), e);
+                    } finally {
+                        if (state != SocketState.LONG) {
+                            connections.remove(Long.valueOf(socket));
+                            recycledProcessors.offer(result);
+                            if (state == SocketState.OPEN) {
+                                proto.endpoint.getPoller().add(socket);
+                            }
+                        } else {
+                            proto.endpoint.getCometPoller().add(socket);
                         }
-                    } else {
-                        proto.endpoint.getCometPoller().add(socket);
                     }
+                } else if (result.async) {
+                    state = asyncDispatch(socket, status);
                 }
             }
             return state;



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


Mime
View raw message