From 238f4c52086defc5a055f2e8d91e7450454d5792 Mon Sep 17 00:00:00 2001
From: Elliotte Rusty Harold
Date: Thu, 24 Oct 2019 15:17:52 -0400
Subject: [PATCH] fix: use platform default TCP buffer sizes (#855)
* remove obsolete and deprecated parent
* use platform default TCP buffer sizes
---
.../client/http/apache/v2/ApacheHttpTransport.java | 14 ++------------
1 file changed, 2 insertions(+), 12 deletions(-)
diff --git a/google-http-client-apache-v2/src/main/java/com/google/api/client/http/apache/v2/ApacheHttpTransport.java b/google-http-client-apache-v2/src/main/java/com/google/api/client/http/apache/v2/ApacheHttpTransport.java
index 0e735f174..864dd072f 100644
--- a/google-http-client-apache-v2/src/main/java/com/google/api/client/http/apache/v2/ApacheHttpTransport.java
+++ b/google-http-client-apache-v2/src/main/java/com/google/api/client/http/apache/v2/ApacheHttpTransport.java
@@ -29,7 +29,6 @@
import org.apache.http.client.methods.HttpPut;
import org.apache.http.client.methods.HttpRequestBase;
import org.apache.http.client.methods.HttpTrace;
-import org.apache.http.config.SocketConfig;
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
@@ -74,7 +73,7 @@ public ApacheHttpTransport() {
* Constructor that allows an alternative Apache HTTP client to be used.
*
*
- * Note that in the previous version, we overrode several settings, however, we are no longer able
+ * Note that in the previous version, we overrode several settings. However, we are no longer able
* to do so.
*
*
@@ -102,12 +101,11 @@ public ApacheHttpTransport(HttpClient httpClient) {
*
*
*
@@ -127,7 +125,6 @@ public static HttpClient newDefaultHttpClient() {
*
*
* - The client connection manager is set to {@link PoolingHttpClientConnectionManager}.
- * - The socket buffer size is set to 8192 using {@link SocketConfig}.
* -
*
- The route planner uses {@link SystemDefaultRoutePlanner} with
@@ -140,17 +137,10 @@ public static HttpClient newDefaultHttpClient() {
* @since 1.31
*/
public static HttpClientBuilder newDefaultHttpClientBuilder() {
- // Set socket buffer sizes to 8192
- SocketConfig socketConfig =
- SocketConfig.custom()
- .setRcvBufSize(8192)
- .setSndBufSize(8192)
- .build();
return HttpClientBuilder.create()
.useSystemProperties()
.setSSLSocketFactory(SSLConnectionSocketFactory.getSocketFactory())
- .setDefaultSocketConfig(socketConfig)
.setMaxConnTotal(200)
.setMaxConnPerRoute(20)
.setConnectionTimeToLive(-1, TimeUnit.MILLISECONDS)