mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-02-11 22:32:38 +08:00
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:
committed by
facebook-github-bot-5
parent
a3085464f6
commit
995b66db82
@@ -411,7 +411,7 @@ RCT_EXPORT_MODULE()
|
||||
task.uploadProgressBlock = uploadProgressBlock;
|
||||
|
||||
if (task.requestID) {
|
||||
if (_tasksByRequestID) {
|
||||
if (!_tasksByRequestID) {
|
||||
_tasksByRequestID = [NSMutableDictionary new];
|
||||
}
|
||||
_tasksByRequestID[task.requestID] = task;
|
||||
|
||||
Reference in New Issue
Block a user