Author: markt
Date: Sat Jan 29 19:27:07 2011
New Revision: 1065091

URL: http://svn.apache.org/viewvc?rev=1065091&view=rev
Log:
Fix breaking tests after recent comet fixes

Modified:
    tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java
    tomcat/trunk/java/org/apache/coyote/http11/LocalStrings.properties

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=1065091&r1=1065090&r2=1065091&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java Sat Jan 
29 19:27:07 2011
@@ -17,7 +17,6 @@
 
 package org.apache.coyote.http11;
 
-import java.io.IOException;
 import java.nio.channels.SelectionKey;
 import java.nio.channels.SocketChannel;
 import java.security.AccessController;
@@ -361,23 +360,23 @@ public class Http11NioProtocol extends A
                     // socket associated with the processor.
                     connections.put(socket, processor);
                     
-                    if (processor.comet) {
-                        // May receive more data from client
-                        SelectionKey key = 
socket.getIOChannel().keyFor(socket.getPoller().getSelector());
-                        NioEndpoint.KeyAttachment att = 
(NioEndpoint.KeyAttachment)socket.getAttachment(false);
-                        key.interestOps(SelectionKey.OP_READ);
-                        att.interestOps(SelectionKey.OP_READ);
-                    } else if (processor.isAsync()) {
+                    if (processor.isAsync()) {
                         NioEndpoint.KeyAttachment att = 
(NioEndpoint.KeyAttachment)socket.getAttachment(false);
                         att.setAsync(true);
                         // longPoll may change socket state (e.g. to trigger a
                         // complete or dispatch)
                         state = processor.asyncPostProcess();
                     } else {
-                        // Error condition. A connection in this state should
-                        // by using one of async or comet
-                        throw new IOException(sm.getString(
-                                "http11protocol.state.long.error"));
+                        // Either:
+                        //  - this is comet request
+                        //  - the request line/headers have not been completely
+                        //    read
+                        SelectionKey key = socket.getIOChannel().keyFor(
+                                socket.getPoller().getSelector());
+                        NioEndpoint.KeyAttachment att =
+                            
(NioEndpoint.KeyAttachment)socket.getAttachment(false);
+                        key.interestOps(SelectionKey.OP_READ);
+                        att.interestOps(SelectionKey.OP_READ);
                     }
                 }
                 if (state == SocketState.LONG || state == 
SocketState.ASYNC_END) {

Modified: tomcat/trunk/java/org/apache/coyote/http11/LocalStrings.properties
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/LocalStrings.properties?rev=1065091&r1=1065090&r2=1065091&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/LocalStrings.properties 
(original)
+++ tomcat/trunk/java/org/apache/coyote/http11/LocalStrings.properties Sat Jan 
29 19:27:07 2011
@@ -20,7 +20,6 @@ http11protocol.proto.ioexception.info=IO
 http11protocol.proto.socketexception.debug=SocketException reading request
 http11protocol.proto.socketexception.info=SocketException reading request, 
ignored
 http11protocol.start=Starting Coyote HTTP/1.1 on {0}
-http11protocol.state.long.error=Error processing request. Socket is in the 
long poll state but neither Servlet 3.0+ async or Comet is being used 
 
 http11processor.regexp.error=Error parsing regular expression {0}
 http11processor.filter.unknown=Unknown filter {0}



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

Reply via email to