mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-30 22:12:42 +08:00
[ReactNative] Fix racing condition on RKHTTPRequestHandler
This commit is contained in:
@@ -134,12 +134,12 @@ typedef void (^RCTHTTPQueryResult)(NSError *error, NSDictionary *result);
|
||||
|
||||
@implementation RCTActiveURLRequest
|
||||
|
||||
- (void)setResponse:(NSURLResponse *)response;
|
||||
- (instancetype)init
|
||||
{
|
||||
_response = response;
|
||||
if (!_incrementalUpdates) {
|
||||
_data = [[NSMutableData alloc] initWithCapacity:(NSUInteger)MAX(0, response.expectedContentLength)];
|
||||
if ((self = [super init])) {
|
||||
_data = [[NSMutableData alloc] init];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user