Fix XMLHttpRequest.abort() not functional due to incorrect lazy loading in RCTNetworking ObjC module
Summary:
Introduced in a major lazy loading refactoring: 060664fd3d
.
This is especially an issue when aborting a long-lived HTTP connection used as a notification channel, as it will use 1 of the maximum 4 connections per host (default limit defined by iOS' NSURLSession).
Closes https://github.com/facebook/react-native/pull/5782
Reviewed By: svcscm
Differential Revision: D2907600
Pulled By: nicklockwood
fb-gh-sync-id: 8406a045904a7ddb61fe1539a0474ec27b5e9e37
This commit is contained in:
parent
a3085464f6
commit
995b66db82
|
@ -411,7 +411,7 @@ RCT_EXPORT_MODULE()
|
||||||
task.uploadProgressBlock = uploadProgressBlock;
|
task.uploadProgressBlock = uploadProgressBlock;
|
||||||
|
|
||||||
if (task.requestID) {
|
if (task.requestID) {
|
||||||
if (_tasksByRequestID) {
|
if (!_tasksByRequestID) {
|
||||||
_tasksByRequestID = [NSMutableDictionary new];
|
_tasksByRequestID = [NSMutableDictionary new];
|
||||||
}
|
}
|
||||||
_tasksByRequestID[task.requestID] = task;
|
_tasksByRequestID[task.requestID] = task;
|
||||||
|
|
Loading…
Reference in New Issue