36
36
37
37
__attribute__ ((constructor))
38
38
static void initialize_tables() {
39
- if (expirationTable == nil )
40
- {
39
+ if (expirationTable == nil ) {
41
40
expirationTable = [[NSMapTable alloc ] init ];
42
41
}
43
42
}
@@ -62,6 +61,7 @@ - (id)init {
62
61
+ (RNFetchBlobNetwork* _Nullable)sharedInstance {
63
62
static id _sharedInstance = nil ;
64
63
static dispatch_once_t onceToken;
64
+
65
65
dispatch_once (&onceToken, ^{
66
66
_sharedInstance = [[self alloc ] init ];
67
67
});
@@ -116,7 +116,7 @@ - (void) cancelRequest:(NSString *)taskId
116
116
task = [self .requestsTable objectForKey: taskId].task ;
117
117
}
118
118
119
- if (task && task.state == NSURLSessionTaskStateRunning ) {
119
+ if (task && task.state == NSURLSessionTaskStateRunning ) {
120
120
[task cancel ];
121
121
}
122
122
}
@@ -125,7 +125,7 @@ - (void) cancelRequest:(NSString *)taskId
125
125
+ (NSMutableDictionary *) normalizeHeaders : (NSDictionary *)headers
126
126
{
127
127
NSMutableDictionary * mheaders = [[NSMutableDictionary alloc ]init];
128
- for (NSString * key in headers) {
128
+ for (NSString * key in headers) {
129
129
[mheaders setValue: [headers valueForKey: key] forKey: [key lowercaseString ]];
130
130
}
131
131
@@ -139,7 +139,7 @@ + (void) emitExpiredTasks
139
139
NSEnumerator * emu = [expirationTable keyEnumerator ];
140
140
NSString * key;
141
141
142
- while ((key = [emu nextObject ]))
142
+ while ((key = [emu nextObject ]))
143
143
{
144
144
RCTBridge * bridge = [RNFetchBlob getRCTBridge ];
145
145
id args = @{ @" taskId" : key };
0 commit comments