hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r233053 - in /jakarta/httpclient/trunk/coyote-httpconnector/src: java/org/apache/http/coyote/HttpProtocolHandler.java java/org/apache/http/coyote/impl/HttpConnectionProcessor.java tests/server.xml
Date Tue, 16 Aug 2005 20:51:07 GMT
Author: olegk
Date: Tue Aug 16 13:51:00 2005
New Revision: 233053

URL: http://svn.apache.org/viewcvs?rev=233053&view=rev
Log:
Additional config options

Modified:
    jakarta/httpclient/trunk/coyote-httpconnector/src/java/org/apache/http/coyote/HttpProtocolHandler.java
    jakarta/httpclient/trunk/coyote-httpconnector/src/java/org/apache/http/coyote/impl/HttpConnectionProcessor.java
    jakarta/httpclient/trunk/coyote-httpconnector/src/tests/server.xml

Modified: jakarta/httpclient/trunk/coyote-httpconnector/src/java/org/apache/http/coyote/HttpProtocolHandler.java
URL: http://svn.apache.org/viewcvs/jakarta/httpclient/trunk/coyote-httpconnector/src/java/org/apache/http/coyote/HttpProtocolHandler.java?rev=233053&r1=233052&r2=233053&view=diff
==============================================================================
--- jakarta/httpclient/trunk/coyote-httpconnector/src/java/org/apache/http/coyote/HttpProtocolHandler.java
(original)
+++ jakarta/httpclient/trunk/coyote-httpconnector/src/java/org/apache/http/coyote/HttpProtocolHandler.java
Tue Aug 16 13:51:00 2005
@@ -65,8 +65,8 @@
     private final HttpParams params;
 
 	private Adapter adapter = null;
-	private int minThreads = 0;
-	private int maxThreads = 20;
+	private int minThreads = 25;
+	private int maxThreads = 150;
     
 	private ConnectionListener listener = null;
 	private ExecutorService listenerExecutor = null;
@@ -79,7 +79,7 @@
 		super();
 		this.params = new DefaultHttpParams(); 
 		this.params
-            .setIntParameter(HttpConnectionParams.SO_TIMEOUT, 10000)
+            .setIntParameter(HttpConnectionParams.SO_TIMEOUT, 20000)
             .setBooleanParameter(HttpConnectionParams.TCP_NODELAY, true) 
             .setParameter(HttpProtocolParams.ORIGIN_SERVER, ORIGIN_SERVER)
 		    .setIntParameter(CoyoteParams.CONNECTOR_PORT, 8080);
@@ -117,6 +117,30 @@
 		HttpConnectionParams.setSoTimeout(this.params, timeout);
 	}
 	
+    public int getSendBuffer() {
+        return HttpConnectionParams.getSendBufferSize(this.params);
+    }
+    
+    public void setSendBuffer(int buffersize) {
+        HttpConnectionParams.setSendBufferSize(this.params, buffersize);
+    }
+    
+    public int getReceiveBuffer() {
+        return HttpConnectionParams.getReceiveBufferSize(this.params);
+    }
+    
+    public void setReceiveBuffer(int buffersize) {
+        HttpConnectionParams.setReceiveBufferSize(this.params, buffersize);
+    }
+    
+    public boolean getTcpNoDelay() {
+        return HttpConnectionParams.getTcpNoDelay(this.params);
+    }
+    
+    public void setTcpNoDelay(boolean b) {
+        HttpConnectionParams.setTcpNoDelay(this.params, b);
+    }
+    
 	public void init() throws Exception {
 		this.conntg = new ThreadGroup("Connection thread group");
 		

Modified: jakarta/httpclient/trunk/coyote-httpconnector/src/java/org/apache/http/coyote/impl/HttpConnectionProcessor.java
URL: http://svn.apache.org/viewcvs/jakarta/httpclient/trunk/coyote-httpconnector/src/java/org/apache/http/coyote/impl/HttpConnectionProcessor.java?rev=233053&r1=233052&r2=233053&view=diff
==============================================================================
--- jakarta/httpclient/trunk/coyote-httpconnector/src/java/org/apache/http/coyote/impl/HttpConnectionProcessor.java
(original)
+++ jakarta/httpclient/trunk/coyote-httpconnector/src/java/org/apache/http/coyote/impl/HttpConnectionProcessor.java
Tue Aug 16 13:51:00 2005
@@ -73,6 +73,7 @@
 import org.apache.http.impl.DefaultConnectionReuseStrategy;
 import org.apache.http.impl.DefaultResponseStrategy;
 import org.apache.http.impl.ResponseStrategy;
+import org.apache.http.params.HttpConnectionParams;
 import org.apache.http.params.HttpParams;
 import org.apache.http.protocol.AbstractHttpProcessor;
 import org.apache.http.protocol.ResponseConnControl;
@@ -110,7 +111,7 @@
     private HttpEntity in = null;
     private CoyoteHttpEntity out = null;
 
-	private byte[] inbuffer = new byte[1024];
+	private final byte[] inbuffer;
 	
     public HttpConnectionProcessor(
             final HttpServerConnection conn,
@@ -138,6 +139,12 @@
         this.coyoteres.setOutputBuffer(this);
         this.coyoteres.setHook(this);
         this.coyoteres.setRequest(this.coyotereq);
+        
+        int buffersize = HttpConnectionParams.getReceiveBufferSize(this.params);
+        if (buffersize < 2048) {
+            buffersize = 2048;
+        }
+        this.inbuffer = new byte[buffersize];
 
         // Add required protocol interceptors
         addResponseInterceptor(new ResponseContent());

Modified: jakarta/httpclient/trunk/coyote-httpconnector/src/tests/server.xml
URL: http://svn.apache.org/viewcvs/jakarta/httpclient/trunk/coyote-httpconnector/src/tests/server.xml?rev=233053&r1=233052&r2=233053&view=diff
==============================================================================
--- jakarta/httpclient/trunk/coyote-httpconnector/src/tests/server.xml (original)
+++ jakarta/httpclient/trunk/coyote-httpconnector/src/tests/server.xml Tue Aug 16 13:51:00
2005
@@ -17,14 +17,17 @@
   <Service name="Catalina">
 
     <Connector port="8080" 
-               maxHttpHeaderSize="8192" minSpareThreads="25" maxThreads="150"
+               maxHttpHeaderSize="8192" socketBuffer="8192"
+               minSpareThreads="25" maxThreads="150"
+               connectionTimeout="20000" tcpNoDelay="true" 
                enableLookups="false" acceptCount="100"
-               connectionTimeout="20000" disableUploadTimeout="true" 
-               compression="off" maxKeepAliveRequests="10000"
-               tcpNoDelay="true"/>
+               disableUploadTimeout="true" 
+               compression="off" maxKeepAliveRequests="10000" />
 
     <Connector port="8888" protocol="org.apache.http.coyote.HttpProtocolHandler"
-               minThreads="25" maxThreads="150" socketTimeout="20000"/>
+   	           receiveBuffer="8192" sendBuffer="8192"
+               minThreads="25" maxThreads="150" 
+               socketTimeout="20000" tcpNoDelay="true" />
 
     <Engine name="Catalina" defaultHost="localhost">
 



Mime
View raw message