remm 01/06/14 07:45:56
Modified: catalina/src/share/org/apache/catalina/connector/http
HttpConnector.java
Log:
- Set TCP no delay to true on the accepted connection. In HTTP/1.1, not
setting it caused unnecessary delays in the TCP stack, since the connection
was usually not closed after processing the request.
Change suggested by Dylan Schell <dylans at xs4all.nl>
Revision Changes Path
1.16 +34 -4
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpConnector.java
Index: HttpConnector.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpConnector.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- HttpConnector.java 2001/05/09 23:42:12 1.15
+++ HttpConnector.java 2001/06/14 14:45:55 1.16
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpConnector.java,v
1.15 2001/05/09 23:42:12 craigmcc Exp $
- * $Revision: 1.15 $
- * $Date: 2001/05/09 23:42:12 $
+ * $Header:
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpConnector.java,v
1.16 2001/06/14 14:45:55 remm Exp $
+ * $Revision: 1.16 $
+ * $Date: 2001/06/14 14:45:55 $
*
* ====================================================================
*
@@ -95,7 +95,7 @@
*
* @author Craig R. McClanahan
* @author Remy Maucherat
- * @version $Revision: 1.15 $ $Date: 2001/05/09 23:42:12 $
+ * @version $Revision: 1.16 $ $Date: 2001/06/14 14:45:55 $
*/
@@ -293,6 +293,12 @@
private boolean allowChunking = true;
+ /**
+ * Use TCP no delay ?
+ */
+ private boolean tcpNoDelay = true;
+
+
// ------------------------------------------------------------- Properties
@@ -713,6 +719,29 @@
}
+ /**
+ * Return the TCP no delay flag value.
+ */
+ public boolean getTcpNoDelay() {
+
+ return (this.tcpNoDelay);
+
+ }
+
+
+ /**
+ * Set the TCP no delay flag which will be set on the socket after
+ * accepting a connection.
+ *
+ * @param tcpNoDelay The new TCP no delay flag
+ */
+ public void setTcpNoDelay(boolean tcpNoDelay) {
+
+ this.tcpNoDelay = tcpNoDelay;
+
+ }
+
+
// --------------------------------------------------------- Public Methods
@@ -905,6 +934,7 @@
// log("run: Returned from
serverSocket.accept()");
if (connectionTimeout > 0)
socket.setSoTimeout(connectionTimeout);
+ setTcpNoDelay(tcpNoDelay);
} catch (AccessControlException ace) {
log("socket accept security exception", ace);
continue;