From: fhanik Date: Fri, 13 Apr 2007 04:19:09 +0000 (+0000) Subject: Since we can keep alive a HTTP connection, even after we have stopped using it as... X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=ba8d4ade8eb6b76b7bc5132ae5b5e342e8f67825;p=tomcat7.0 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 git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@528347 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/coyote/http11/Http11NioProcessor.java b/java/org/apache/coyote/http11/Http11NioProcessor.java index 8f091ece0..6fd23fd60 100644 --- a/java/org/apache/coyote/http11/Http11NioProcessor.java +++ b/java/org/apache/coyote/http11/Http11NioProcessor.java @@ -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) {