Skip to content
This repository was archived by the owner on Jan 21, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions MASFoundation.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2163,7 +2163,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2.0.00;
CURRENT_PROJECT_VERSION = 2.0.10;
DEAD_CODE_STRIPPING = YES;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = "";
Expand Down Expand Up @@ -2195,6 +2195,7 @@
"$(PROJECT_DIR)/MASFoundation/Vendor/OpenSSL/include/lib",
);
MACH_O_TYPE = mh_dylib;
MARKETING_VERSION = 2.0.10;
ONLY_ACTIVE_ARCH = NO;
PRODUCT_BUNDLE_IDENTIFIER = "com.ca.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -2211,7 +2212,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2.0.00;
CURRENT_PROJECT_VERSION = 2.0.10;
DEAD_CODE_STRIPPING = YES;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = "";
Expand Down Expand Up @@ -2243,6 +2244,7 @@
"$(PROJECT_DIR)/MASFoundation/Vendor/OpenSSL/include/lib",
);
MACH_O_TYPE = mh_dylib;
MARKETING_VERSION = 2.0.10;
ONLY_ACTIVE_ARCH = NO;
PRODUCT_BUNDLE_IDENTIFIER = "com.ca.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
2 changes: 1 addition & 1 deletion MASFoundation/Classes/MAS.h
Original file line number Diff line number Diff line change
Expand Up @@ -1158,7 +1158,7 @@ withParameters:(NSDictionary *_Nullable)parameterInfo
* @param task MASDataTask object that was obtained as a result of invoking a request using the API invoke:taksBlock:completion:
*/

+ (void)cancelRequest:(nonnull MASDataTask*)task error:(NSError*_Nullable*_Nullable)error;
+ (BOOL)cancelRequest:(nonnull MASDataTask*)task error:(NSError*_Nullable*_Nullable)error;


/**
Expand Down
11 changes: 7 additions & 4 deletions MASFoundation/Classes/MAS.m
Original file line number Diff line number Diff line change
Expand Up @@ -1222,19 +1222,22 @@ + (void)postMultiPartForm:(nonnull MASRequest *)request constructingBodyWithBloc
}


+ (void)cancelRequest:(nonnull MASDataTask*)task error:(NSError**)error
+ (BOOL)cancelRequest:(nonnull MASDataTask*)task error:(NSError**)error
{
//
// Check if MAS has been started.
//
if ([MAS MASState] != MASStateDidStart)
{
*error = [NSError errorMASIsNotStarted];
return;
if(error != NULL){
*error = [NSError errorMASIsNotStarted];
}

return NO;

}

[[MASNetworkingService sharedService] cancelRequest:task error:error];
return [[MASNetworkingService sharedService] cancelRequest:task error:error];
}

+ (void)cancelAllRequests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,7 @@ timeoutInterval:(NSTimeInterval)timeoutInterval

- (void)httpRequestWithCancel:(MASRequest*)request taskBlock:(MASDataTaskBlock)taskBlock completion:(MASResponseInfoErrorBlock)completion;

- (void)cancelRequest:(MASDataTask*)task error:(NSError**)error;
- (BOOL)cancelRequest:(MASDataTask*)task error:(NSError**)error;

- (void)cancelAllRequests;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1858,7 +1858,7 @@ - (void)cleanUpFinishedTasks
NSLog(@"cleanUpFinishedTasks : finished cleaning up");
}

- (void)cancelRequest:(MASDataTask*)task error:(NSError**)error;
- (BOOL)cancelRequest:(MASDataTask*)task error:(NSError**)error;
{
NSString* taskID = task.taskID;
if(self.tasks && [self.tasks objectForKey:taskID]){
Expand All @@ -1867,14 +1867,22 @@ - (void)cancelRequest:(MASDataTask*)task error:(NSError**)error;
[self.tasks removeObjectForKey:taskToBeCancelled.taskID];

if (!isTaskCancelled){
*error = [NSError errorDataTaskNotFound];
if (error != NULL){
*error = [NSError errorDataTaskNotFound];
}
return NO;
}
}
else {
//task not found error
*error = [NSError errorDataTaskNotFound];
if (error != NULL){
*error = [NSError errorDataTaskNotFound];
}
return NO;
}

return YES;

}


Expand Down
2 changes: 1 addition & 1 deletion MASFoundation/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>2.0.00</string>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down