hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1720387 - /httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/DefaultHttpClientConnectionOperator.java
Date Wed, 16 Dec 2015 16:19:32 GMT
Author: olegk
Date: Wed Dec 16 16:19:32 2015
New Revision: 1720387

URL: http://svn.apache.org/viewvc?rev=1720387&view=rev
Log:
Set socker buffer send/receive sizes from SocketConfig
Contributed by  Will Vuong <wvuong at chariotsolutions.com>

Modified:
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/DefaultHttpClientConnectionOperator.java

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/DefaultHttpClientConnectionOperator.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/DefaultHttpClientConnectionOperator.java?rev=1720387&r1=1720386&r2=1720387&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/DefaultHttpClientConnectionOperator.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/DefaultHttpClientConnectionOperator.java
Wed Dec 16 16:19:32 2015
@@ -28,9 +28,9 @@ package org.apache.http.impl.conn;
 
 import java.io.IOException;
 import java.net.ConnectException;
-import java.net.NoRouteToHostException;
 import java.net.InetAddress;
 import java.net.InetSocketAddress;
+import java.net.NoRouteToHostException;
 import java.net.Socket;
 import java.net.SocketTimeoutException;
 
@@ -120,6 +120,13 @@ public class DefaultHttpClientConnection
             sock.setReuseAddress(socketConfig.isSoReuseAddress());
             sock.setTcpNoDelay(socketConfig.isTcpNoDelay());
             sock.setKeepAlive(socketConfig.isSoKeepAlive());
+            if (socketConfig.getRcvBufSize() > 0) {
+                sock.setReceiveBufferSize(socketConfig.getRcvBufSize());
+            }
+            if (socketConfig.getSndBufSize() > 0) {
+                sock.setSendBufferSize(socketConfig.getSndBufSize());
+            }
+
             final int linger = socketConfig.getSoLinger();
             if (linger >= 0) {
                 sock.setSoLinger(true, linger);



Mime
View raw message