From f496d98402a0e02cbae74aa8f0929d4517b7132b Mon Sep 17 00:00:00 2001 From: Dulmandakh Date: Thu, 17 Jan 2019 13:18:08 +0800 Subject: [PATCH] use okhttp callTimeout to set request timeout --- .../com/facebook/react/modules/network/NetworkingModule.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/modules/network/NetworkingModule.java b/ReactAndroid/src/main/java/com/facebook/react/modules/network/NetworkingModule.java index eb84d6e33d9c24..7db2dbc2d19fea 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/modules/network/NetworkingModule.java +++ b/ReactAndroid/src/main/java/com/facebook/react/modules/network/NetworkingModule.java @@ -324,8 +324,8 @@ public void onProgress(long bytesWritten, long contentLength, boolean done) { // client and set the timeout explicitly on the clone. This is cheap as everything else is // shared under the hood. // See https://github.com/square/okhttp/wiki/Recipes#per-call-configuration for more information - if (timeout != mClient.connectTimeoutMillis()) { - clientBuilder.connectTimeout(timeout, TimeUnit.MILLISECONDS); + if (timeout != mClient.callTimeoutMillis()) { + clientBuilder.callTimeout(timeout, TimeUnit.MILLISECONDS); } OkHttpClient client = clientBuilder.build();