Browse Source

Fix OkHttp3 unexpected end of stream error

reference https://github.com/square/okhttp/issues/2738
Ben Hsieh 9 years ago
parent
commit
d31c414e15
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      src/android/src/main/java/com/RNFetchBlob/RNFetchBlobReq.java

+ 1
- 1
src/android/src/main/java/com/RNFetchBlob/RNFetchBlobReq.java View File

332
             clientBuilder.retryOnConnectionFailure(false);
332
             clientBuilder.retryOnConnectionFailure(false);
333
             clientBuilder.followRedirects(true);
333
             clientBuilder.followRedirects(true);
334
 
334
 
335
-            OkHttpClient client = clientBuilder.build();
335
+            OkHttpClient client = clientBuilder.retryOnConnectionFailure(true).build();
336
             Call call =  client.newCall(req);
336
             Call call =  client.newCall(req);
337
             taskTable.put(taskId, call);
337
             taskTable.put(taskId, call);
338
             call.enqueue(new okhttp3.Callback() {
338
             call.enqueue(new okhttp3.Callback() {