Browse Source

Add the possibility of webDAV search with contentType

Marino Faggiana 7 years ago
parent
commit
f9e18c61da
1 changed files with 11 additions and 12 deletions
  1. 11 12
      iOSClient/Library/OCCommunicationLib/OCCommunication.m

+ 11 - 12
iOSClient/Library/OCCommunicationLib/OCCommunication.m

@@ -639,14 +639,19 @@
         
         if (successRequest) {
             
-            NSData *responseData = (NSData*) responseObject;
+            dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{
+
+                NSData *responseData = (NSData*) responseObject;
             
-            OCXMLListParser *parser = [OCXMLListParser new];
-            [parser initParserWithData:responseData];
-            NSMutableArray *searchList = [parser.searchList mutableCopy];
+                OCXMLListParser *parser = [OCXMLListParser new];
+                [parser initParserWithData:responseData];
+                NSMutableArray *searchList = [parser.searchList mutableCopy];
             
-            //Return success
-            successRequest(response, searchList, request.redirectedServer, token);
+                //Return success
+                dispatch_async(dispatch_get_main_queue(), ^{
+                    successRequest(response, searchList, request.redirectedServer, token);
+                });
+            });
         }
         
     } failure:^(NSHTTPURLResponse *response, id responseData, NSError *error, NSString *token) {
@@ -818,17 +823,11 @@
             failure(response, nil, request.redirectedServer);
         }
         
-        
     } failure:^(NSHTTPURLResponse *response, NSData *responseData, NSError *error) {
         failure(response, error, request.redirectedServer);
     }];
-
-    
-    
-    
 }
 
-
 - (void) readSharedByServer: (NSString *) path
             onCommunication:(OCCommunication *)sharedOCCommunication
              successRequest:(void(^)(NSHTTPURLResponse *response, NSArray *listOfShared, NSString *redirectedServer)) successRequest