This repository was archived by the owner on Mar 16, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,8 @@ - (void) sendRequest:(RCTBridge *)bridgeRef taskId:(NSString *)taskId withReques
5454 self.respData = [[NSMutableData alloc ] initWithLength: 0 ];
5555 self.callback = callback;
5656 self.bridge = bridgeRef;
57+ self.expectedBytes = 0 ;
58+ self.receivedBytes = 0 ;
5759 // Call long-running code on background thread
5860 NSURLConnection *conn = [[NSURLConnection alloc ] initWithRequest: req delegate: self startImmediately: NO ];
5961 [conn scheduleInRunLoop: [NSRunLoop mainRunLoop ] forMode: NSRunLoopCommonModes ];
@@ -74,7 +76,7 @@ - (void) connection:(NSURLConnection *)connection didReceiveResponse:(nonnull NS
7476}
7577
7678- (void ) connection : (NSURLConnection *)connection didReceiveData : (nonnull NSData *)data {
77- receivedBytes = data.length ;
79+ receivedBytes + = data.length ;
7880 [respData appendData: data];
7981
8082 [self .bridge.eventDispatcher
@@ -90,7 +92,7 @@ - (void) connection:(NSURLConnection *)connection didReceiveData:(nonnull NSData
9092- (void ) connection : (NSURLConnection *)connection didSendBodyData : (NSInteger )bytesWritten totalBytesWritten : (NSInteger )totalBytesWritten totalBytesExpectedToWrite : (NSInteger )totalBytesExpectedToWrite {
9193
9294 expectedBytes = totalBytesExpectedToWrite;
93- receivedBytes = totalBytesWritten;
95+ receivedBytes + = totalBytesWritten;
9496 [self .bridge.eventDispatcher
9597 sendAppEventWithName: @" RNFetchBlobProgress"
9698 body: @{
You can’t perform that action at this time.
0 commit comments