Skip to content
This repository was archived by the owner on Mar 16, 2019. It is now read-only.

Commit 195499a

Browse files
committed
Remove use OkHttp default connection pool timeout #72
1 parent f118228 commit 195499a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/android/src/main/java/com/RNFetchBlob/RNFetchBlobReq.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ enum ResponseType {
7575
public static HashMap<String, Call> taskTable = new HashMap<>();
7676
static HashMap<String, Boolean> progressReport = new HashMap<>();
7777
static HashMap<String, Boolean> uploadProgressReport = new HashMap<>();
78-
static ConnectionPool pool = new ConnectionPool(5, 30000, TimeUnit.MILLISECONDS);
78+
static ConnectionPool pool = new ConnectionPool();
7979

8080
MediaType contentType = RNFetchBlobConst.MIME_OCTET;
8181
ReactApplicationContext ctx;
@@ -315,6 +315,10 @@ public Response intercept(Chain chain) throws IOException {
315315
clientBuilder.connectTimeout(options.timeout, TimeUnit.MILLISECONDS);
316316
clientBuilder.readTimeout(options.timeout, TimeUnit.MILLISECONDS);
317317
}
318+
else {
319+
clientBuilder.connectTimeout(-1, TimeUnit.MILLISECONDS);
320+
clientBuilder.readTimeout(-1, TimeUnit.MILLISECONDS);
321+
}
318322
clientBuilder.connectionPool(pool);
319323
clientBuilder.retryOnConnectionFailure(false);
320324
OkHttpClient client = clientBuilder.build();

0 commit comments

Comments
 (0)