From: markt Date: Sat, 29 Jan 2011 19:27:07 +0000 (+0000) Subject: Fix breaking tests after recent comet fixes X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=113a21388187dd264fb46fd4c97bd691e75b0e35;p=tomcat7.0 Fix breaking tests after recent comet fixes git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1065091 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/coyote/http11/Http11NioProtocol.java b/java/org/apache/coyote/http11/Http11NioProtocol.java index 0735d8095..e91fdfcfe 100644 --- a/java/org/apache/coyote/http11/Http11NioProtocol.java +++ b/java/org/apache/coyote/http11/Http11NioProtocol.java @@ -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 AbstractHttp11JsseProtocol { // 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) { diff --git a/java/org/apache/coyote/http11/LocalStrings.properties b/java/org/apache/coyote/http11/LocalStrings.properties index 92e193311..c0c27fc36 100644 --- a/java/org/apache/coyote/http11/LocalStrings.properties +++ b/java/org/apache/coyote/http11/LocalStrings.properties @@ -20,7 +20,6 @@ http11protocol.proto.ioexception.info=IOException reading request, ignored 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}