configure can be called as long as we are on a tomcat thread, not in the begin stage
authorfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 28 May 2007 14:18:04 +0000 (14:18 +0000)
committerfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 28 May 2007 14:18:04 +0000 (14:18 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@542235 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/connector/CometEventImpl.java

index 9828afd..1577296 100644 (file)
@@ -119,13 +119,11 @@ public class CometEventImpl implements CometEvent {
         return response.getResponse();
     }
 
-    public void setTimeout(int timeout) throws IOException, ServletException,
-            UnsupportedOperationException {
+    public void setTimeout(int timeout) throws IOException, ServletException,UnsupportedOperationException {
+        //this check should get removed as soon as connection timeout is implemented everywhere.
         if (request.getAttribute("org.apache.tomcat.comet.timeout.support") == Boolean.TRUE) {
             checkWorkerThread();
-            Integer to = new Integer(timeout);
-            request.action(ActionCode.ACTION_COMET_TIMEOUT,to);
-            //request.setAttribute("org.apache.tomcat.comet.timeout", to);
+            request.action(ActionCode.ACTION_COMET_TIMEOUT,new Integer(timeout));
         } else {
             throw new UnsupportedOperationException();
         }
@@ -142,9 +140,6 @@ public class CometEventImpl implements CometEvent {
     public void configure(CometEvent.CometConfiguration... options)
         throws IOException, IllegalStateException {
         checkWorkerThread();
-        if (getEventType()!=EventType.BEGIN) {
-            throw new IllegalStateException("Configure can only be called during the BEGIN event.");
-        }
         throw new UnsupportedOperationException();
     }