hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r561083 - in /jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl: DefaultHttpClientConnection.java DefaultHttpServerConnection.java SocketHttpClientConnection.java SocketHttpServerConnection.java
Date Mon, 30 Jul 2007 18:31:19 GMT
Author: olegk
Date: Mon Jul 30 11:31:17 2007
New Revision: 561083

URL: http://svn.apache.org/viewvc?view=rev&rev=561083
Log:
Moved socket initialization code from SocketHttp*Connection to DefaultHttp*Connection classes

Modified:
    jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/DefaultHttpClientConnection.java
    jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/DefaultHttpServerConnection.java
    jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/SocketHttpClientConnection.java
    jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/SocketHttpServerConnection.java

Modified: jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/DefaultHttpClientConnection.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/DefaultHttpClientConnection.java?view=diff&rev=561083&r1=561082&r2=561083
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/DefaultHttpClientConnection.java
(original)
+++ jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/DefaultHttpClientConnection.java
Mon Jul 30 11:31:17 2007
@@ -34,6 +34,7 @@
 import java.io.IOException;
 import java.net.Socket;
 
+import org.apache.http.params.HttpConnectionParams;
 import org.apache.http.params.HttpParams;
 
 /**
@@ -54,7 +55,20 @@
     public void bind(
             final Socket socket, 
             final HttpParams params) throws IOException {
+        if (socket == null) {
+            throw new IllegalArgumentException("Socket may not be null");
+        }
+        if (params == null) {
+            throw new IllegalArgumentException("HTTP parameters may not be null");
+        }
         assertNotOpen();
+        socket.setTcpNoDelay(HttpConnectionParams.getTcpNoDelay(params));
+        socket.setSoTimeout(HttpConnectionParams.getSoTimeout(params));
+        
+        int linger = HttpConnectionParams.getLinger(params);
+        if (linger >= 0) {
+            socket.setSoLinger(linger > 0, linger);
+        }
         super.bind(socket, params);
     }
 

Modified: jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/DefaultHttpServerConnection.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/DefaultHttpServerConnection.java?view=diff&rev=561083&r1=561082&r2=561083
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/DefaultHttpServerConnection.java
(original)
+++ jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/DefaultHttpServerConnection.java
Mon Jul 30 11:31:17 2007
@@ -34,6 +34,7 @@
 import java.io.IOException;
 import java.net.Socket;
 
+import org.apache.http.params.HttpConnectionParams;
 import org.apache.http.params.HttpParams;
 
 /**
@@ -52,7 +53,20 @@
     }
     
     public void bind(final Socket socket, final HttpParams params) throws IOException {
+        if (socket == null) {
+            throw new IllegalArgumentException("Socket may not be null");
+        }
+        if (params == null) {
+            throw new IllegalArgumentException("HTTP parameters may not be null");
+        }
         assertNotOpen();
+        socket.setTcpNoDelay(HttpConnectionParams.getTcpNoDelay(params));
+        socket.setSoTimeout(HttpConnectionParams.getSoTimeout(params));
+        
+        int linger = HttpConnectionParams.getLinger(params);
+        if (linger >= 0) {
+            socket.setSoLinger(linger > 0, linger);
+        }
         super.bind(socket, params);
     }
 

Modified: jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/SocketHttpClientConnection.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/SocketHttpClientConnection.java?view=diff&rev=561083&r1=561082&r2=561083
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/SocketHttpClientConnection.java
(original)
+++ jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/SocketHttpClientConnection.java
Mon Jul 30 11:31:17 2007
@@ -99,14 +99,6 @@
         if (params == null) {
             throw new IllegalArgumentException("HTTP parameters may not be null");
         }
-        socket.setTcpNoDelay(HttpConnectionParams.getTcpNoDelay(params));
-        socket.setSoTimeout(HttpConnectionParams.getSoTimeout(params));
-        
-        int linger = HttpConnectionParams.getLinger(params);
-        if (linger >= 0) {
-            socket.setSoLinger(linger > 0, linger);
-        }
-
         this.socket = socket;
 
         int buffersize = HttpConnectionParams.getSocketBufferSize(params);

Modified: jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/SocketHttpServerConnection.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/SocketHttpServerConnection.java?view=diff&rev=561083&r1=561082&r2=561083
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/SocketHttpServerConnection.java
(original)
+++ jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/SocketHttpServerConnection.java
Mon Jul 30 11:31:17 2007
@@ -97,14 +97,6 @@
         if (params == null) {
             throw new IllegalArgumentException("HTTP parameters may not be null");
         }
-        socket.setTcpNoDelay(HttpConnectionParams.getTcpNoDelay(params));
-        socket.setSoTimeout(HttpConnectionParams.getSoTimeout(params));
-        
-        int linger = HttpConnectionParams.getLinger(params);
-        if (linger >= 0) {
-            socket.setSoLinger(linger > 0, linger);
-        }
-
         this.socket = socket;
         
         int buffersize = HttpConnectionParams.getSocketBufferSize(params);



Mime
View raw message