[ReactNative] Fix racing condition on RKHTTPRequestHandler

This commit is contained in:
Tadeu Zagallo 2015-06-15 11:23:30 -07:00
parent c30365acba
commit 58c58d9bed
1 changed files with 4 additions and 4 deletions

View File

@ -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