From 250311819ad9a756c9a5c2968a8b7cbf524140fe Mon Sep 17 00:00:00 2001 From: mturk Date: Fri, 29 Sep 2006 14:58:32 +0000 Subject: [PATCH] Revert Keep-Alive patch. git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@451318 13f79535-47bb-0310-9956-ffa450edef68 --- java/org/apache/catalina/connector/mbeans-descriptors.xml | 4 ---- java/org/apache/catalina/startup/ContextConfig.java | 1 - java/org/apache/coyote/ajp/AjpAprProtocol.java | 10 ---------- java/org/apache/coyote/http11/Http11AprProcessor.java | 2 ++ java/org/apache/coyote/http11/Http11AprProtocol.java | 14 -------------- java/org/apache/coyote/http11/Http11Processor.java | 1 + java/org/apache/coyote/http11/Http11Protocol.java | 1 + java/org/apache/jasper/compiler/Generator.java | 2 +- java/org/apache/tomcat/util/net/AprEndpoint.java | 12 ++---------- 9 files changed, 7 insertions(+), 40 deletions(-) diff --git a/java/org/apache/catalina/connector/mbeans-descriptors.xml b/java/org/apache/catalina/connector/mbeans-descriptors.xml index 58ba947ef..5651d53c2 100644 --- a/java/org/apache/catalina/connector/mbeans-descriptors.xml +++ b/java/org/apache/catalina/connector/mbeans-descriptors.xml @@ -93,10 +93,6 @@ description="Maximum number of Keep-Alive requests to honor per connection" type="int"/> - - diff --git a/java/org/apache/catalina/startup/ContextConfig.java b/java/org/apache/catalina/startup/ContextConfig.java index f9145bbd6..f9ec1061f 100644 --- a/java/org/apache/catalina/startup/ContextConfig.java +++ b/java/org/apache/catalina/startup/ContextConfig.java @@ -616,7 +616,6 @@ public class ContextConfig source = new InputSource("file://" + file.getAbsolutePath()); stream = new FileInputStream(file); - context.addWatchedResource(file.getAbsolutePath()); } } catch (Exception e) { log.error(sm.getString("contextConfig.defaultMissing") diff --git a/java/org/apache/coyote/ajp/AjpAprProtocol.java b/java/org/apache/coyote/ajp/AjpAprProtocol.java index 6a10a1d5b..9a3f0387e 100644 --- a/java/org/apache/coyote/ajp/AjpAprProtocol.java +++ b/java/org/apache/coyote/ajp/AjpAprProtocol.java @@ -68,7 +68,6 @@ public class AjpAprProtocol cHandler = new AjpConnectionHandler(this); setSoLinger(Constants.DEFAULT_CONNECTION_LINGER); setSoTimeout(Constants.DEFAULT_CONNECTION_TIMEOUT); - setKeepAliveTimeout(Constants.DEFAULT_CONNECTION_TIMEOUT); //setServerSoTimeout(Constants.DEFAULT_SERVER_SOCKET_TIMEOUT); setTcpNoDelay(Constants.DEFAULT_TCP_NO_DELAY); } @@ -418,15 +417,6 @@ public class AjpAprProtocol setAttribute("soTimeout", "" + i); } - public int getKeepAliveTimeout() { - return ep.getKeepAliveTimeout(); - } - - - public void setKeepAliveTimeout( int i ) { - ep.setKeepAliveTimeout(i); - setAttribute("keepAliveTimeout", "" + i); - } public void setRequiredSecret(String requiredSecret) { this.requiredSecret = requiredSecret; diff --git a/java/org/apache/coyote/http11/Http11AprProcessor.java b/java/org/apache/coyote/http11/Http11AprProcessor.java index e0c858874..3b3daf4ee 100644 --- a/java/org/apache/coyote/http11/Http11AprProcessor.java +++ b/java/org/apache/coyote/http11/Http11AprProcessor.java @@ -208,6 +208,7 @@ public class Http11AprProcessor implements ActionHook { */ protected int maxKeepAliveRequests = -1; + /** * SSL enabled ? */ @@ -642,6 +643,7 @@ public class Http11AprProcessor implements ActionHook { return maxKeepAliveRequests; } + /** * Set the maximum size of a POST which will be buffered in SSL mode. */ diff --git a/java/org/apache/coyote/http11/Http11AprProtocol.java b/java/org/apache/coyote/http11/Http11AprProtocol.java index 960b7a5c9..fd2718405 100644 --- a/java/org/apache/coyote/http11/Http11AprProtocol.java +++ b/java/org/apache/coyote/http11/Http11AprProtocol.java @@ -54,7 +54,6 @@ public class Http11AprProtocol implements ProtocolHandler, MBeanRegistration cHandler = new Http11ConnectionHandler( this ); setSoLinger(Constants.DEFAULT_CONNECTION_LINGER); setSoTimeout(Constants.DEFAULT_CONNECTION_TIMEOUT); - setKeepAliveTimeout(Constants.DEFAULT_CONNECTION_TIMEOUT); //setServerSoTimeout(Constants.DEFAULT_SERVER_SOCKET_TIMEOUT); setTcpNoDelay(Constants.DEFAULT_TCP_NO_DELAY); } @@ -464,19 +463,6 @@ public class Http11AprProtocol implements ProtocolHandler, MBeanRegistration } /** - * The number of seconds Tomcat will wait for a subsequent request - * before closing the connection. The default is the same as for - * Apache HTTP Server (15 000 milliseconds). - */ - public int getKeepAliveTimeout() { - return ep.getKeepAliveTimeout(); - } - - public void setKeepAliveTimeout(int timeout) { - ep.setKeepAliveTimeout(timeout); - } - - /** * Return the Keep-Alive policy for the connection. */ public boolean getKeepAlive() { diff --git a/java/org/apache/coyote/http11/Http11Processor.java b/java/org/apache/coyote/http11/Http11Processor.java index a5fc68a36..58c823071 100644 --- a/java/org/apache/coyote/http11/Http11Processor.java +++ b/java/org/apache/coyote/http11/Http11Processor.java @@ -620,6 +620,7 @@ public class Http11Processor implements ActionHook { return maxKeepAliveRequests; } + /** * Set the maximum size of a POST which will be buffered in SSL mode. */ diff --git a/java/org/apache/coyote/http11/Http11Protocol.java b/java/org/apache/coyote/http11/Http11Protocol.java index 9483c816d..a1a92abed 100644 --- a/java/org/apache/coyote/http11/Http11Protocol.java +++ b/java/org/apache/coyote/http11/Http11Protocol.java @@ -281,6 +281,7 @@ public class Http11Protocol public int getMaxKeepAliveRequests() { return maxKeepAliveRequests; } public void setMaxKeepAliveRequests(int mkar) { maxKeepAliveRequests = mkar; } + // HTTP /** * This timeout represents the socket timeout which will be used while diff --git a/java/org/apache/jasper/compiler/Generator.java b/java/org/apache/jasper/compiler/Generator.java index 537bd7202..bb20079e5 100644 --- a/java/org/apache/jasper/compiler/Generator.java +++ b/java/org/apache/jasper/compiler/Generator.java @@ -3276,7 +3276,7 @@ class Generator { out.printil("out = _jspx_out;"); out.printil("if (out != null && out.getBufferSize() != 0)"); out.pushIndent(); - out.printil("try { out.clearBuffer(); } catch (java.io.IOException e) {}"); + out.printil("out.clearBuffer();"); out.popIndent(); out diff --git a/java/org/apache/tomcat/util/net/AprEndpoint.java b/java/org/apache/tomcat/util/net/AprEndpoint.java index 08dca2dee..617f9a016 100644 --- a/java/org/apache/tomcat/util/net/AprEndpoint.java +++ b/java/org/apache/tomcat/util/net/AprEndpoint.java @@ -257,14 +257,6 @@ public class AprEndpoint { /** - * Keep-Alive timeout. - */ - protected int keepAliveTimeout = -1; - public int getKeepAliveTimeout() { return keepAliveTimeout; } - public void setKeepAliveTimeout(int timeout) { keepAliveTimeout = timeout; } - - - /** * Timeout on first request read before going to the poller, in ms. */ protected int firstReadTimeout = -1; @@ -1156,11 +1148,11 @@ public class AprEndpoint { protected void init() { pool = Pool.create(serverSockPool); int size = pollerSize / pollerThreadCount; - int timeout = keepAliveTimeout; + int timeout = soTimeout; if (comet) { // FIXME: Find an appropriate timeout value, for now, "longer than usual" // semms appropriate - timeout = keepAliveTimeout * 50; + timeout = soTimeout * 50; } serverPollset = allocatePoller(size, pool, timeout); if (serverPollset == 0 && size > 1024) { -- 2.11.0