Since we can keep alive a HTTP connection, even after we have stopped using it as...
authorfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 13 Apr 2007 04:19:09 +0000 (04:19 +0000)
committerfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 13 Apr 2007 04:19:09 +0000 (04:19 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@528347 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/coyote/http11/Http11NioProcessor.java

index 8f091ec..6fd23fd 100644 (file)
@@ -757,8 +757,14 @@ public class Http11NioProcessor implements ActionHook {
                 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 @@ public class Http11NioProcessor implements ActionHook {
                         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) {