Author: fhanik
Date: Thu Apr 12 21:19:09 2007
New Revision: 528347

URL: http://svn.apache.org/viewvc?view=rev&rev=528347
Log:
Since we can keep alive a HTTP connection, even after we have stopped using it 
as a comet, then we need to go back to the original timeout

Modified:
    tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java

Modified: 
tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java?view=diff&rev=528347&r1=528346&r2=528347
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java 
(original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java 
Thu Apr 12 21:19:09 2007
@@ -757,8 +757,14 @@
                 NioEndpoint.KeyAttachment attach = 
(NioEndpoint.KeyAttachment)socket.getAttachment(false);
                 if (attach != null) {
                     attach.setComet(comet);
-                    Integer comettimeout = (Integer) 
request.getAttribute("org.apache.tomcat.comet.timeout");
-                    if (comettimeout != null) 
attach.setTimeout(comettimeout.longValue());
+                    if (comet) {
+                        Integer comettimeout = (Integer) 
request.getAttribute("org.apache.tomcat.comet.timeout");
+                        if (comettimeout != null) 
attach.setTimeout(comettimeout.longValue());
+                    } else {
+                        //reset the timeout
+                        
attach.setTimeout(endpoint.getSocketProperties().getSoTimeout());
+                    }
+
                 }
             }
         } catch (InterruptedIOException e) {
@@ -903,8 +909,10 @@
                         NioEndpoint.KeyAttachment attach = 
(NioEndpoint.KeyAttachment) key.attachment();
                         if (attach != null)  {
                             attach.setComet(comet);
-                            Integer comettimeout = (Integer) 
request.getAttribute("org.apache.tomcat.comet.timeout");
-                            if (comettimeout != null) 
attach.setTimeout(comettimeout.longValue());
+                            if (comet) {
+                                Integer comettimeout = (Integer) 
request.getAttribute("org.apache.tomcat.comet.timeout");
+                                if (comettimeout != null) 
attach.setTimeout(comettimeout.longValue());
+                            }
                         }
                     }
                 } catch (InterruptedIOException e) {



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to