29
29
import org .apache .http .client .methods .HttpPut ;
30
30
import org .apache .http .client .methods .HttpRequestBase ;
31
31
import org .apache .http .client .methods .HttpTrace ;
32
- import org .apache .http .config .SocketConfig ;
33
32
import org .apache .http .conn .ssl .SSLConnectionSocketFactory ;
34
33
import org .apache .http .impl .client .CloseableHttpClient ;
35
34
import org .apache .http .impl .client .HttpClientBuilder ;
@@ -74,7 +73,7 @@ public ApacheHttpTransport() {
74
73
* Constructor that allows an alternative Apache HTTP client to be used.
75
74
*
76
75
* <p>
77
- * Note that in the previous version, we overrode several settings, however , we are no longer able
76
+ * Note that in the previous version, we overrode several settings. However , we are no longer able
78
77
* to do so.
79
78
* </p>
80
79
*
@@ -102,12 +101,11 @@ public ApacheHttpTransport(HttpClient httpClient) {
102
101
* </p>
103
102
* <ul>
104
103
* <li>The client connection manager is set to {@link PoolingHttpClientConnectionManager}.</li>
105
- * <li>The socket buffer size is set to 8192 using {@link SocketConfig}.</li>
106
104
* <li><The retry mechanism is turned off using
107
105
* {@link HttpClientBuilder#disableRedirectHandling}.</li>
108
106
* <li>The route planner uses {@link SystemDefaultRoutePlanner} with
109
107
* {@link ProxySelector#getDefault()}, which uses the proxy settings from <a
110
- * href="http ://docs.oracle.com/javase/7/docs/api/java/net/doc-files/net-properties.html">system
108
+ * href="https ://docs.oracle.com/javase/7/docs/api/java/net/doc-files/net-properties.html">system
111
109
* properties</a>.</li>
112
110
* </ul>
113
111
*
@@ -127,7 +125,6 @@ public static HttpClient newDefaultHttpClient() {
127
125
* </p>
128
126
* <ul>
129
127
* <li>The client connection manager is set to {@link PoolingHttpClientConnectionManager}.</li>
130
- * <li>The socket buffer size is set to 8192 using {@link SocketConfig}.</li>
131
128
* <li><The retry mechanism is turned off using
132
129
* {@link HttpClientBuilder#disableRedirectHandling}.</li>
133
130
* <li>The route planner uses {@link SystemDefaultRoutePlanner} with
@@ -140,17 +137,10 @@ public static HttpClient newDefaultHttpClient() {
140
137
* @since 1.31
141
138
*/
142
139
public static HttpClientBuilder newDefaultHttpClientBuilder () {
143
- // Set socket buffer sizes to 8192
144
- SocketConfig socketConfig =
145
- SocketConfig .custom ()
146
- .setRcvBufSize (8192 )
147
- .setSndBufSize (8192 )
148
- .build ();
149
140
150
141
return HttpClientBuilder .create ()
151
142
.useSystemProperties ()
152
143
.setSSLSocketFactory (SSLConnectionSocketFactory .getSocketFactory ())
153
- .setDefaultSocketConfig (socketConfig )
154
144
.setMaxConnTotal (200 )
155
145
.setMaxConnPerRoute (20 )
156
146
.setConnectionTimeToLive (-1 , TimeUnit .MILLISECONDS )
0 commit comments