File tree 3 files changed +56
-6
lines changed
src/main/java/com/RNFetchBlob
3 files changed +56
-6
lines changed Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+ <projectDescription >
3
+ <name >android</name >
4
+ <comment >Project android created by Buildship.</comment >
5
+ <projects >
6
+ </projects >
7
+ <buildSpec >
8
+ <buildCommand >
9
+ <name >org.eclipse.buildship.core.gradleprojectbuilder</name >
10
+ <arguments >
11
+ </arguments >
12
+ </buildCommand >
13
+ </buildSpec >
14
+ <natures >
15
+ <nature >org.eclipse.buildship.core.gradleprojectnature</nature >
16
+ </natures >
17
+ <filteredResources >
18
+ <filter >
19
+ <id >1634215444278</id >
20
+ <name ></name >
21
+ <type >30</type >
22
+ <matcher >
23
+ <id >org.eclipse.core.resources.regexFilterMatcher</id >
24
+ <arguments >node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments >
25
+ </matcher >
26
+ </filter >
27
+ </filteredResources >
28
+ </projectDescription >
Original file line number Diff line number Diff line change
1
+ arguments =
2
+ auto.sync =false
3
+ build.scans.enabled =false
4
+ connection.gradle.distribution =GRADLE_DISTRIBUTION(WRAPPER)
5
+ connection.project.dir =
6
+ eclipse.preferences.version =1
7
+ gradle.user.home =
8
+ java.home =/Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home
9
+ jvm.arguments =
10
+ offline.mode =false
11
+ override.workspace.settings =true
12
+ show.console.view =true
13
+ show.executions.view =true
Original file line number Diff line number Diff line change @@ -392,8 +392,9 @@ public Response intercept(Chain chain) throws IOException {
392
392
clientBuilder .addInterceptor (new Interceptor () {
393
393
@ Override
394
394
public Response intercept (@ NonNull Chain chain ) throws IOException {
395
+ Response originalResponse = null ;
395
396
try {
396
- Response originalResponse = chain .proceed (req );
397
+ originalResponse = chain .proceed (req );
397
398
ResponseBody extended ;
398
399
switch (responseType ) {
399
400
case KeepInMemory :
@@ -423,13 +424,21 @@ public Response intercept(@NonNull Chain chain) throws IOException {
423
424
}
424
425
catch (SocketException e ) {
425
426
timeout = true ;
426
- }
427
- catch (SocketTimeoutException e ){
427
+ if (originalResponse != null ) {
428
+ originalResponse .close ();
429
+ }
430
+ } catch (SocketTimeoutException e ) {
428
431
timeout = true ;
429
- //RNFetchBlobUtils.emitWarningEvent("RNFetchBlob error when sending request : " + e.getLocalizedMessage());
430
- } catch (Exception ex ) {
431
-
432
+ if (originalResponse != null ) {
433
+ originalResponse .close ();
434
+ }
435
+ //ReactNativeBlobUtilUtils.emitWarningEvent("ReactNativeBlobUtil error when sending request : " + e.getLocalizedMessage());
436
+ } catch (Exception ex ) {
437
+ if (originalResponse != null ) {
438
+ originalResponse .close ();
439
+ }
432
440
}
441
+
433
442
return chain .proceed (chain .request ());
434
443
}
435
444
});
You can’t perform that action at this time.
0 commit comments