When using a comet connection, register the requested operations instead of the defau...
authorfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 29 May 2007 22:13:26 +0000 (22:13 +0000)
committerfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 29 May 2007 22:13:26 +0000 (22:13 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@542674 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/coyote/http11/Http11NioProtocol.java

index 53e858e..dcd5f4e 100644 (file)
@@ -670,7 +670,8 @@ public class Http11NioProtocol implements ProtocolHandler, MBeanRegistration
                     } else {
                         if (log.isDebugEnabled()) log.debug("Keeping processor["+result);
                         //add correct poller events here based on Comet stuff
-                        socket.getPoller().add(socket);
+                        NioEndpoint.KeyAttachment att = (NioEndpoint.KeyAttachment)socket.getAttachment(false);
+                        socket.getPoller().add(socket,att.getCometOps());
                     }
                 }
             }
@@ -711,7 +712,12 @@ public class Http11NioProtocol implements ProtocolHandler, MBeanRegistration
                     // processor.
                     if (log.isDebugEnabled()) log.debug("Not recycling ["+processor+"] Comet="+((NioEndpoint.KeyAttachment)socket.getAttachment(false)).getComet());
                     connections.put(socket, processor);
-                    socket.getPoller().add(socket);
+                    if (processor.comet) {
+                        NioEndpoint.KeyAttachment att = (NioEndpoint.KeyAttachment)socket.getAttachment(false);
+                        socket.getPoller().add(socket,att.getCometOps());
+                    } else {
+                        socket.getPoller().add(socket);
+                    }
                 } else {
                     recycledProcessors.offer(processor);
                 }