- Correctly pass keepalive value to AprEndpoint.
- Sendfile should use soTimeout (it's a request, not a keepalive).
- Comet poller is also a request in progress so use soTimeout too (most likely it would need its own timeout value).
- I will adjust the defaults further, as for example I think keepALiveTimeout should default to soTimeout if not set
(ie, if it's -1).
git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@480558
13f79535-47bb-0310-9956-
ffa450edef68
*/
void release() {
+ for (int i = 0; i < n; i++) {
+ filters[i] = null;
+ }
n = 0;
pos = 0;
servlet = null;
public static final int DEFAULT_CONNECTION_LINGER = -1;
public static final int DEFAULT_CONNECTION_TIMEOUT = -1;
public static final int DEFAULT_CONNECTION_UPLOAD_TIMEOUT = 300000;
- public static final int DEFAULT_KEEPALIVE_TIMEOUT = 15000;
+ public static final int DEFAULT_KEEPALIVE_TIMEOUT = -1;
public static final int DEFAULT_SERVER_SOCKET_TIMEOUT = 0;
public static final boolean DEFAULT_TCP_NO_DELAY = true;
public static final int DEFAULT_CONNECTION_LINGER = -1;
public static final int DEFAULT_CONNECTION_TIMEOUT = 60000;
public static final int DEFAULT_CONNECTION_UPLOAD_TIMEOUT = 300000;
- public static final int DEFAULT_KEEPALIVE_TIMEOUT = 15000;
+ public static final int DEFAULT_KEEPALIVE_TIMEOUT = 60000;
public static final int DEFAULT_SERVER_SOCKET_TIMEOUT = 0;
public static final boolean DEFAULT_TCP_NO_DELAY = true;
*/
protected int maxKeepAliveRequests = -1;
- /**
- * The number of seconds Tomcat will wait for a subsequent request
- * before closing the connection.
- */
- protected int keepAliveTimeout = 15000;
-
/**
* SSL enabled ?
return timeout;
}
- /**
- * Set the Keep-Alive timeout.
- */
- public void setKeepAliveTimeout(int timeout) {
- keepAliveTimeout = timeout;
- }
-
- /**
- * Return the number Keep-Alive timeout.
- */
- public int getKeepAliveTimeout() {
- return keepAliveTimeout;
- }
-
/**
* Set the server header name.
*/
private int socketBuffer = 9000;
private Adapter adapter;
private Http11ConnectionHandler cHandler;
- private int keepAliveTimeout = 15000; // 15 seconds as in Apache HTTPD server
/**
* Compression value.
/**
* 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).
+ * before closing the connection.
*/
- public int getKeepAliveTimeout()
- {
- return keepAliveTimeout;
+ public int getKeepAliveTimeout() {
+ return ep.getKeepAliveTimeout();
}
- public void setKeepAliveTimeout(int timeout)
- {
- keepAliveTimeout = timeout;
+ public void setKeepAliveTimeout(int timeout) {
+ ep.setKeepAliveTimeout(timeout);
}
/**
/**
* Keep-Alive timeout.
*/
- protected int keepAliveTimeout = 15000;
- public int getKeepAliveTimeout()
- {
- return keepAliveTimeout;
- }
-
- public void setKeepAliveTimeout(int timeout)
- {
- keepAliveTimeout = timeout;
- }
+ protected int keepAliveTimeout = -1;
+ public int getKeepAliveTimeout() { return keepAliveTimeout; }
+ public void setKeepAliveTimeout(int keepAliveTimeout) { this.keepAliveTimeout = keepAliveTimeout; }
/**
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) {
protected void init() {
pool = Pool.create(serverSockPool);
int size = sendfileSize / sendfileThreadCount;
- sendfilePollset = allocatePoller(size, pool, keepAliveTimeout);
+ sendfilePollset = allocatePoller(size, pool, soTimeout);
if (sendfilePollset == 0 && size > 1024) {
size = 1024;
- sendfilePollset = allocatePoller(size, pool, keepAliveTimeout);
+ sendfilePollset = allocatePoller(size, pool, soTimeout);
}
if (sendfilePollset == 0) {
size = 62;
- sendfilePollset = allocatePoller(size, pool, keepAliveTimeout);
+ sendfilePollset = allocatePoller(size, pool, soTimeout);
}
desc = new long[size * 2];
sendfileData = new HashMap<Long, SendfileData>(size);