marinofaggiana 4 years ago
parent
commit
0af1526f3c
3 changed files with 2 additions and 26 deletions
  1. 0 1
      iOSClient/CCGlobal.h
  2. 0 23
      iOSClient/Networking/CCNetworking.m
  3. 2 2
      iOSClient/Transfers/CCTransfers.m

+ 0 - 1
iOSClient/CCGlobal.h

@@ -114,7 +114,6 @@
 
 // Session
 #define k_upload_session                                @"it.twsweb.Crypto-Cloud.upload.session"
-#define k_upload_session_foreground                     @"it.twsweb.Crypto-Cloud.upload.sessionforeground"
 #define k_upload_session_wwan                           @"it.twsweb.Crypto-Cloud.upload.sessionwwan"
 
 // Service Key Share

+ 0 - 23
iOSClient/Networking/CCNetworking.m

@@ -56,7 +56,6 @@
 
     [self sessionUpload];
     [self sessionWWanUpload];
-    [self sessionUploadForeground];
     
     return self;
 }
@@ -106,30 +105,10 @@
     return sessionWWanUpload;
 }
 
-- (NSURLSession *)sessionUploadForeground
-{
-    static NSURLSession *sessionUploadForeground;
-    
-    if (sessionUploadForeground == nil) {
-        
-        NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration];
-        
-        configuration.allowsCellularAccess = YES;
-        configuration.discretionary = NO;
-        configuration.HTTPMaximumConnectionsPerHost = k_maxHTTPConnectionsPerHost;
-        configuration.requestCachePolicy = NSURLRequestReloadIgnoringLocalCacheData;
-        
-        sessionUploadForeground = [NSURLSession sessionWithConfiguration:configuration delegate:self delegateQueue:nil];
-        sessionUploadForeground.sessionDescription = k_upload_session_foreground;
-    }
-    return sessionUploadForeground;
-}
-
 - (NSURLSession *)getSessionfromSessionDescription:(NSString *)sessionDescription
 {
     if ([sessionDescription isEqualToString:k_upload_session]) return [self sessionUpload];
     if ([sessionDescription isEqualToString:k_upload_session_wwan]) return [self sessionWWanUpload];
-    if ([sessionDescription isEqualToString:k_upload_session_foreground]) return [self sessionUploadForeground];
     
     return nil;
 }
@@ -139,7 +118,6 @@
  
     [[self sessionUpload] invalidateAndCancel];
     [[self sessionWWanUpload] invalidateAndCancel];
-    [[self sessionUploadForeground] invalidateAndCancel];
 }
 
 #pragma --------------------------------------------------------------------------------------------
@@ -451,7 +429,6 @@
      NSURLSession *sessionUpload;
      if ([metadata.session isEqualToString:k_upload_session]) sessionUpload = [self sessionUpload];
      else if ([metadata.session isEqualToString:k_upload_session_wwan]) sessionUpload = [self sessionWWanUpload];
-     else if ([metadata.session isEqualToString:k_upload_session_foreground]) sessionUpload = [self sessionUploadForeground];
      
      NSURLSessionUploadTask *uploadTask = [sessionUpload uploadTaskWithRequest:request fromFile:[NSURL fileURLWithPath:[CCUtility getDirectoryProviderStorageOcId:metadata.ocId fileNameView:metadata.fileName]]];
      

+ 2 - 2
iOSClient/Transfers/CCTransfers.m

@@ -315,7 +315,7 @@
 
     NSInteger queueDownload = [[[NCManageDatabase sharedInstance] getMetadatasWithPredicate:[NSPredicate predicateWithFormat:@"session == %@", sessionDownload] sorted:nil ascending:NO] count];
 
-    NSInteger queueUpload = [[[NCManageDatabase sharedInstance] getMetadatasWithPredicate:[NSPredicate predicateWithFormat:@"session == %@ OR session == %@", k_upload_session, k_upload_session_foreground] sorted:nil ascending:NO] count];
+    NSInteger queueUpload = [[[NCManageDatabase sharedInstance] getMetadatasWithPredicate:[NSPredicate predicateWithFormat:@"session == %@", k_upload_session] sorted:nil ascending:NO] count];
     NSInteger queueUploadWWan = [[[NCManageDatabase sharedInstance] getMetadatasWithPredicate:[NSPredicate predicateWithFormat:@"session == %@", k_upload_session_wwan] sorted:nil ascending:NO] count];
     
     if ([[sectionDataSource.sections objectAtIndex:section] isKindOfClass:[NSString class]]) titleSection = [sectionDataSource.sections objectAtIndex:section];
@@ -412,7 +412,7 @@
     // Footer Upload
     if ([titleSection containsString:@"upload"] && ![titleSection containsString:@"wwan"] && titleSection != nil) {
         
-        NSInteger queueUpload = [[[NCManageDatabase sharedInstance] getMetadatasWithPredicate:[NSPredicate predicateWithFormat:@"session == %@ OR session == %@", k_upload_session, k_upload_session_foreground] sorted:nil ascending:NO] count];
+        NSInteger queueUpload = [[[NCManageDatabase sharedInstance] getMetadatasWithPredicate:[NSPredicate predicateWithFormat:@"session == %@", k_upload_session] sorted:nil ascending:NO] count];
         
         // element or elements ?
         if (queueUpload > 1) element_s = NSLocalizedString(@"_elements_",nil);