|
@@ -133,7 +133,7 @@ NSOperationQueue *taskQueue;
|
133
|
133
|
|
134
|
134
|
// the session trust any SSL certification
|
135
|
135
|
|
136
|
|
-
|
|
136
|
+
|
137
|
137
|
NSURLSessionConfiguration *defaultConfigObject = [NSURLSessionConfiguration defaultSessionConfiguration];
|
138
|
138
|
if([options valueForKey:@"timeout"] != nil)
|
139
|
139
|
{
|
|
@@ -153,7 +153,7 @@ NSOperationQueue *taskQueue;
|
153
|
153
|
|
154
|
154
|
destPath = [RNFetchBlobFS getTempPath:cacheKey withExtension:[self.options valueForKey:CONFIG_FILE_EXT]];
|
155
|
155
|
if ([[NSFileManager defaultManager] fileExistsAtPath:destPath]) {
|
156
|
|
- callback(@[[NSNull null], destPath]);
|
|
156
|
+ callback(@[[NSNull null], @[[NSNull null], destPath]);
|
157
|
157
|
return;
|
158
|
158
|
}
|
159
|
159
|
}
|
|
@@ -190,7 +190,7 @@ NSOperationQueue *taskQueue;
|
190
|
190
|
- (void) URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)dataTask didReceiveResponse:(NSURLResponse *)response completionHandler:(void (^)(NSURLSessionResponseDisposition))completionHandler
|
191
|
191
|
{
|
192
|
192
|
expectedBytes = [response expectedContentLength];
|
193
|
|
-
|
|
193
|
+
|
194
|
194
|
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse*)response;
|
195
|
195
|
NSInteger statusCode = [(NSHTTPURLResponse *)response statusCode];
|
196
|
196
|
if ([response respondsToSelector:@selector(allHeaderFields)])
|
|
@@ -229,7 +229,7 @@ NSOperationQueue *taskQueue;
|
229
|
229
|
@"timeout" : @NO,
|
230
|
230
|
@"status": [NSString stringWithFormat:@"%d", statusCode ]
|
231
|
231
|
};
|
232
|
|
-
|
|
232
|
+
|
233
|
233
|
[self.bridge.eventDispatcher
|
234
|
234
|
sendDeviceEventWithName: EVENT_STATE_CHANGE
|
235
|
235
|
body:respInfo
|
|
@@ -272,7 +272,7 @@ NSOperationQueue *taskQueue;
|
272
|
272
|
{
|
273
|
273
|
[writeStream write:[data bytes] maxLength:[data length]];
|
274
|
274
|
}
|
275
|
|
-
|
|
275
|
+
|
276
|
276
|
if([progressTable valueForKey:taskId] == @YES)
|
277
|
277
|
{
|
278
|
278
|
[self.bridge.eventDispatcher
|
|
@@ -296,15 +296,15 @@ NSOperationQueue *taskQueue;
|
296
|
296
|
|
297
|
297
|
- (void) URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didCompleteWithError:(NSError *)error
|
298
|
298
|
{
|
299
|
|
-
|
|
299
|
+
|
300
|
300
|
self.error = error;
|
301
|
301
|
[[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO];
|
302
|
|
-
|
|
302
|
+
|
303
|
303
|
NSString * respType = [respInfo valueForKey:@"respType"];
|
304
|
304
|
if(error != nil) {
|
305
|
305
|
NSLog([error localizedDescription]);
|
306
|
306
|
}
|
307
|
|
-
|
|
307
|
+
|
308
|
308
|
if(respFile == YES)
|
309
|
309
|
{
|
310
|
310
|
[writeStream close];
|
|
@@ -321,7 +321,7 @@ NSOperationQueue *taskQueue;
|
321
|
321
|
[respData base64EncodedStringWithOptions:0]
|
322
|
322
|
]);
|
323
|
323
|
}
|
324
|
|
-
|
|
324
|
+
|
325
|
325
|
[taskTable removeObjectForKey:taskId];
|
326
|
326
|
[uploadProgressTable removeObjectForKey:taskId];
|
327
|
327
|
[progressTable removeObjectForKey:taskId];
|