hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r234202 - in /jakarta/httpclient/trunk/coyote-httpconnector/src: java/org/apache/http/coyote/ java/org/apache/http/coyote/impl/ java/org/apache/http/coyote/params/ tests/
Date Sun, 21 Aug 2005 13:55:28 GMT
Author: olegk
Date: Sun Aug 21 06:55:16 2005
New Revision: 234202

URL: http://svn.apache.org/viewcvs?rev=234202&view=rev
Log:
Removed option to override system RCV_BUFFER_SIZE and SND_BUFFER_SIZE parameters

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/java/org/apache/http/coyote/params/CoyoteParams.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=234202&r1=234201&r2=234202&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
Sun Aug 21 06:55:16 2005
@@ -95,6 +95,14 @@
         CoyoteParams.setPort(this.params, port);
 	}
 
+	public int getReadBuffer() {
+		return CoyoteParams.getReadBuffer(this.params);
+	}
+	
+	public void setReadBuffer(int port) {
+        CoyoteParams.setReadBuffer(this.params, port);
+	}
+
 	public int getMinThreads() {
 		return this.minThreads;
 	}
@@ -119,22 +127,6 @@
 		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);
     }
@@ -154,7 +146,7 @@
 	public void setMode(final String mode) {
 		if ("NIO".equalsIgnoreCase(mode)) {
 			this.useNIO = true;
-		} else if ("OldIO".equalsIgnoreCase(mode)) {
+		} else if ("ClassicIO".equalsIgnoreCase(mode)) {
 			this.useNIO = false;
 		} else {
 			if (LOG.isWarnEnabled()) {

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=234202&r1=234201&r2=234202&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
Sun Aug 21 06:55:16 2005
@@ -75,7 +75,6 @@
 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;
@@ -142,7 +141,7 @@
         this.coyoteres.setHook(this);
         this.coyoteres.setRequest(this.coyotereq);
         
-        int buffersize = HttpConnectionParams.getReceiveBufferSize(this.params);
+        int buffersize = CoyoteParams.getReadBuffer(this.params);
         if (buffersize < 2048) {
             buffersize = 2048;
         }

Modified: jakarta/httpclient/trunk/coyote-httpconnector/src/java/org/apache/http/coyote/params/CoyoteParams.java
URL: http://svn.apache.org/viewcvs/jakarta/httpclient/trunk/coyote-httpconnector/src/java/org/apache/http/coyote/params/CoyoteParams.java?rev=234202&r1=234201&r2=234202&view=diff
==============================================================================
--- jakarta/httpclient/trunk/coyote-httpconnector/src/java/org/apache/http/coyote/params/CoyoteParams.java
(original)
+++ jakarta/httpclient/trunk/coyote-httpconnector/src/java/org/apache/http/coyote/params/CoyoteParams.java
Sun Aug 21 06:55:16 2005
@@ -50,6 +50,14 @@
     public static final String CONNECTOR_PORT = "http.connector.port"; 
 
     /**
+     * Defines the size of the read buffer in bytes.
+     * <p>
+     * This parameter expects a value of type {@link Integer}.
+     * </p>
+     */
+    public static final String READ_BUFFER = "http.connector.readbuffer"; 
+    
+    /**
      */
     private CoyoteParams() {
         super();
@@ -79,4 +87,27 @@
         params.setIntParameter(CONNECTOR_PORT, port);
     }
 
+    /**
+     * Returns the size of the read buffer. 
+     *
+     * @return buffer size in bytes
+     */
+    public static int getReadBuffer(final HttpParams params) { 
+        if (params == null) {
+            throw new IllegalArgumentException("HTTP parameters may not be null");
+        }
+        return params.getIntParameter(READ_BUFFER, 8192);
+    }
+    
+    /**
+     * Sets the size of the read buffer. 
+     *
+     * @param size buffer size in bytes
+     */
+    public static void setReadBuffer(final HttpParams params, int size) {
+        if (params == null) {
+            throw new IllegalArgumentException("HTTP parameters may not be null");
+        }
+        params.setIntParameter(READ_BUFFER, size);
+    }
 }

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=234202&r1=234201&r2=234202&view=diff
==============================================================================
--- jakarta/httpclient/trunk/coyote-httpconnector/src/tests/server.xml (original)
+++ jakarta/httpclient/trunk/coyote-httpconnector/src/tests/server.xml Sun Aug 21 06:55:16
2005
@@ -17,17 +17,16 @@
   <Service name="Catalina">
 
     <Connector port="8080" 
-               maxHttpHeaderSize="8192" socketBuffer="8192"
                minSpareThreads="25" maxThreads="150"
-               connectionTimeout="20000" tcpNoDelay="true" 
+               socketBuffer="8192" tcpNoDelay="true" 
+               connectionTimeout="20000" 
                enableLookups="false" acceptCount="100"
-               disableUploadTimeout="true" 
                compression="off" maxKeepAliveRequests="10000" />
 
     <Connector port="8888" protocol="org.apache.http.coyote.HttpProtocolHandler"
-   	           receiveBuffer="8192" sendBuffer="8192"
                minThreads="25" maxThreads="150" 
-               mode="OldIO" socketTimeout="20000" tcpNoDelay="true" />
+   	           mode="ClassicIO" readBuffer="8192" 
+               socketTimeout="20000" tcpNoDelay="true" />
 
     <Engine name="Catalina" defaultHost="localhost">
 



Mime
View raw message