package org.apache.coyote.http11;
-import java.io.IOException;
import java.nio.channels.SelectionKey;
import java.nio.channels.SocketChannel;
import java.security.AccessController;
// 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) {
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}