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
54
54
self.respData = [[NSMutableData alloc ] initWithLength: 0 ];
55
55
self.callback = callback;
56
56
self.bridge = bridgeRef;
57
+ self.expectedBytes = 0 ;
58
+ self.receivedBytes = 0 ;
57
59
// Call long-running code on background thread
58
60
NSURLConnection *conn = [[NSURLConnection alloc ] initWithRequest: req delegate: self startImmediately: NO ];
59
61
[conn scheduleInRunLoop: [NSRunLoop mainRunLoop ] forMode: NSRunLoopCommonModes ];
@@ -74,7 +76,7 @@ - (void) connection:(NSURLConnection *)connection didReceiveResponse:(nonnull NS
74
76
}
75
77
76
78
- (void ) connection : (NSURLConnection *)connection didReceiveData : (nonnull NSData *)data {
77
- receivedBytes = data.length ;
79
+ receivedBytes + = data.length ;
78
80
[respData appendData: data];
79
81
80
82
[self .bridge.eventDispatcher
@@ -90,7 +92,7 @@ - (void) connection:(NSURLConnection *)connection didReceiveData:(nonnull NSData
90
92
- (void ) connection : (NSURLConnection *)connection didSendBodyData : (NSInteger )bytesWritten totalBytesWritten : (NSInteger )totalBytesWritten totalBytesExpectedToWrite : (NSInteger )totalBytesExpectedToWrite {
91
93
92
94
expectedBytes = totalBytesExpectedToWrite;
93
- receivedBytes = totalBytesWritten;
95
+ receivedBytes + = totalBytesWritten;
94
96
[self .bridge.eventDispatcher
95
97
sendAppEventWithName: @" RNFetchBlobProgress"
96
98
body: @{
You can’t perform that action at this time.
0 commit comments