Permalink
Browse files

Merge pull request #12 from shazino/development

MendeleySDK v1.3.1
  • Loading branch information...
2 parents cef3d6b + 3fcfffc commit 00fabc257306f5678392c4e80a8110ea24857a48 @julientherier julientherier committed Oct 14, 2013
Showing with 3,249 additions and 2,908 deletions.
  1. +2 −1 Examples/MendeleySDKDemo/MendeleySDKDemo.xcodeproj/project.pbxproj
  2. +1 −1 Examples/MendeleySDKDemo/MendeleySDKDemo.xcodeproj/xcshareddata/xcschemes/MendeleySDKDemo.xcscheme
  3. +1 −1 ...es/MendeleySDKDemo/MendeleySDKDemo.xcodeproj/xcshareddata/xcschemes/MendeleySDKDemoTests.xcscheme
  4. +8 −8 Examples/MendeleySDKDemo/Podfile.lock
  5. +1 −3 Examples/MendeleySDKDemo/Pods/AFNetworking/AFNetworking/AFHTTPClient.h
  6. +56 −34 Examples/MendeleySDKDemo/Pods/AFNetworking/AFNetworking/AFHTTPClient.m
  7. +8 −0 Examples/MendeleySDKDemo/Pods/AFNetworking/AFNetworking/AFHTTPRequestOperation.m
  8. +20 −24 Examples/MendeleySDKDemo/Pods/AFNetworking/AFNetworking/AFImageRequestOperation.m
  9. +2 −39 Examples/MendeleySDKDemo/Pods/AFNetworking/AFNetworking/AFURLConnectionOperation.h
  10. +64 −125 Examples/MendeleySDKDemo/Pods/AFNetworking/AFNetworking/AFURLConnectionOperation.m
  11. +18 −11 Examples/MendeleySDKDemo/Pods/AFNetworking/AFNetworking/UIImageView+AFNetworking.m
  12. +10 −14 Examples/MendeleySDKDemo/Pods/AFNetworking/README.md
  13. +41 −0 Examples/MendeleySDKDemo/Pods/AFOAuth1Client/AFOAuth1Client/AFOAuth1Client.h
  14. +139 −43 Examples/MendeleySDKDemo/Pods/AFOAuth1Client/AFOAuth1Client/AFOAuth1Client.m
  15. +17 −2 Examples/MendeleySDKDemo/Pods/AFOAuth1Client/README.md
  16. +21 −6 Examples/MendeleySDKDemo/Pods/Local Podspecs/MendeleySDK.podspec
  17. +8 −8 Examples/MendeleySDKDemo/Pods/Manifest.lock
  18. +12 −2 Examples/MendeleySDKDemo/Pods/Pods-AFOAuth1Client-prefix.pch
  19. +1 −1 Examples/MendeleySDKDemo/Pods/Pods-AFOAuth1Client.xcconfig
  20. +12 −0 Examples/MendeleySDKDemo/Pods/Pods-MendeleySDK-prefix.pch
  21. +12 −2 Examples/MendeleySDKDemo/Pods/Pods-MendeleySDKDemoTests-AFOAuth1Client-prefix.pch
  22. +1 −1 Examples/MendeleySDKDemo/Pods/Pods-MendeleySDKDemoTests-AFOAuth1Client.xcconfig
  23. +12 −0 Examples/MendeleySDKDemo/Pods/Pods-MendeleySDKDemoTests-MendeleySDK-prefix.pch
  24. +3 −3 Examples/MendeleySDKDemo/Pods/Pods-MendeleySDKDemoTests-environment.h
  25. +14 −7 Examples/MendeleySDKDemo/Pods/Pods-MendeleySDKDemoTests-resources.sh
  26. +3 −3 Examples/MendeleySDKDemo/Pods/Pods-environment.h
  27. +14 −7 Examples/MendeleySDKDemo/Pods/Pods-resources.sh
  28. +2,717 −2,538 Examples/MendeleySDKDemo/Pods/Pods.xcodeproj/project.pbxproj
  29. +2 −2 Examples/MendeleySDKDemo/Pods/Pods.xcodeproj/xcshareddata/xcschemes/Pods-AFNetworking.xcscheme
  30. +2 −2 Examples/MendeleySDKDemo/Pods/Pods.xcodeproj/xcshareddata/xcschemes/Pods-AFOAuth1Client.xcscheme
  31. +2 −2 Examples/MendeleySDKDemo/Pods/Pods.xcodeproj/xcshareddata/xcschemes/Pods-MendeleySDK.xcscheme
  32. +2 −2 ...DKDemo/Pods/Pods.xcodeproj/xcshareddata/xcschemes/Pods-MendeleySDKDemoTests-AFNetworking.xcscheme
  33. +2 −2 ...Demo/Pods/Pods.xcodeproj/xcshareddata/xcschemes/Pods-MendeleySDKDemoTests-AFOAuth1Client.xcscheme
  34. +2 −2 ...SDKDemo/Pods/Pods.xcodeproj/xcshareddata/xcschemes/Pods-MendeleySDKDemoTests-MendeleySDK.xcscheme
  35. +2 −2 ...les/MendeleySDKDemo/Pods/Pods.xcodeproj/xcshareddata/xcschemes/Pods-MendeleySDKDemoTests.xcscheme
  36. +2 −2 Examples/MendeleySDKDemo/Pods/Pods.xcodeproj/xcshareddata/xcschemes/Pods.xcscheme
  37. +6 −6 MendeleySDK.podspec
  38. +8 −1 MendeleySDK/MDLDocument.m
  39. +1 −1 README.md
@@ -399,7 +399,7 @@
isa = PBXProject;
attributes = {
CLASSPREFIX = MDL;
- LastUpgradeCheck = 0450;
+ LastUpgradeCheck = 0500;
ORGANIZATIONNAME = shazino;
};
buildConfigurationList = 14C1E2BF16246F27005D914C /* Build configuration list for PBXProject "MendeleySDKDemo" */;
@@ -608,6 +608,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
+ ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
};
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
- LastUpgradeVersion = "0460"
+ LastUpgradeVersion = "0500"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
- LastUpgradeVersion = "0460"
+ LastUpgradeVersion = "0500"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -1,9 +1,9 @@
PODS:
- - AFNetworking (1.3.1)
- - AFOAuth1Client (0.2.0):
- - AFNetworking (>= 1.0)
+ - AFNetworking (1.3.3)
+ - AFOAuth1Client (0.3.1):
+ - AFNetworking (~> 1.3)
- MendeleySDK (1.2):
- - AFOAuth1Client (= 0.2.0)
+ - AFOAuth1Client (~> 0.3.0)
DEPENDENCIES:
- MendeleySDK (from `../../`)
@@ -13,8 +13,8 @@ EXTERNAL SOURCES:
:path: ../../
SPEC CHECKSUMS:
- AFNetworking: 9ec8aafb9269236a7630bd8d9838ce2ba30fa2a0
- AFOAuth1Client: 3e01e6e4218116c2e279671c8ab086133514a350
- MendeleySDK: d0f02c49f838001993225e05cad4f974afde90c5
+ AFNetworking: 0700ec7a58c36ad217173e167f6e4df7270df66b
+ AFOAuth1Client: 8e83e357129c6dd4511dbb77b03977b206383dc1
+ MendeleySDK: 9a60755d89fbc47cc7fd34621498afa5fd82e853
-COCOAPODS: 0.22.3
+COCOAPODS: 0.26.2
@@ -118,7 +118,7 @@ typedef enum {
@property (nonatomic, assign) NSStringEncoding stringEncoding;
/**
- The `AFHTTPClientParameterEncoding` value corresponding to how parameters are encoded into a request body. This is `AFFormURLParameterEncoding` by default.
+ The `AFHTTPClientParameterEncoding` value corresponding to how parameters are encoded into a request body for request methods other than `GET`, `HEAD` or `DELETE`. This is `AFFormURLParameterEncoding` by default.
@warning Some nested parameter structures, such as a keyed array of hashes containing inconsistent keys (i.e. `@{@"": @[@{@"a" : @(1)}, @{@"b" : @(2)}]}`), cannot be unambiguously represented in query strings. It is strongly recommended that an unambiguous encoding, such as `AFJSONParameterEncoding`, is used when posting complicated or nondeterministic parameter structures.
*/
@@ -141,9 +141,7 @@ typedef enum {
/**
Default SSL pinning mode for each `AFHTTPRequestOperation` created by `HTTPRequestOperationWithRequest:success:failure:`.
*/
-#ifdef _AFNETWORKING_PIN_SSL_CERTIFICATES_
@property (nonatomic, assign) AFURLConnectionOperationSSLPinningMode defaultSSLPinningMode;
-#endif
/**
Whether each `AFHTTPRequestOperation` created by `HTTPRequestOperationWithRequest:success:failure:` should accept an invalid SSL certificate.
@@ -80,11 +80,16 @@
return [[NSString alloc] initWithData:mutableData encoding:NSASCIIStringEncoding];
}
-static NSString * AFPercentEscapedQueryStringPairMemberFromStringWithEncoding(NSString *string, NSStringEncoding encoding) {
- static NSString * const kAFCharactersToBeEscaped = @":/?&=;+!@#$()',*";
- static NSString * const kAFCharactersToLeaveUnescaped = @"[].";
+static NSString * const kAFCharactersToBeEscapedInQueryString = @":/?&=;+!@#$()',*";
- return (__bridge_transfer NSString *)CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, (__bridge CFStringRef)string, (__bridge CFStringRef)kAFCharactersToLeaveUnescaped, (__bridge CFStringRef)kAFCharactersToBeEscaped, CFStringConvertNSStringEncodingToEncoding(encoding));
+static NSString * AFPercentEscapedQueryStringKeyFromStringWithEncoding(NSString *string, NSStringEncoding encoding) {
+ static NSString * const kAFCharactersToLeaveUnescapedInQueryStringPairKey = @"[].";
+
+ return (__bridge_transfer NSString *)CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, (__bridge CFStringRef)string, (__bridge CFStringRef)kAFCharactersToLeaveUnescapedInQueryStringPairKey, (__bridge CFStringRef)kAFCharactersToBeEscapedInQueryString, CFStringConvertNSStringEncodingToEncoding(encoding));
+}
+
+static NSString * AFPercentEscapedQueryStringValueFromStringWithEncoding(NSString *string, NSStringEncoding encoding) {
+ return (__bridge_transfer NSString *)CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, (__bridge CFStringRef)string, NULL, (__bridge CFStringRef)kAFCharactersToBeEscapedInQueryString, CFStringConvertNSStringEncodingToEncoding(encoding));
}
#pragma mark -
@@ -116,9 +121,9 @@ - (id)initWithField:(id)field value:(id)value {
- (NSString *)URLEncodedStringValueWithEncoding:(NSStringEncoding)stringEncoding {
if (!self.value || [self.value isEqual:[NSNull null]]) {
- return AFPercentEscapedQueryStringPairMemberFromStringWithEncoding([self.field description], stringEncoding);
+ return AFPercentEscapedQueryStringKeyFromStringWithEncoding([self.field description], stringEncoding);
} else {
- return [NSString stringWithFormat:@"%@=%@", AFPercentEscapedQueryStringPairMemberFromStringWithEncoding([self.field description], stringEncoding), AFPercentEscapedQueryStringPairMemberFromStringWithEncoding([self.value description], stringEncoding)];
+ return [NSString stringWithFormat:@"%@=%@", AFPercentEscapedQueryStringKeyFromStringWithEncoding([self.field description], stringEncoding), AFPercentEscapedQueryStringValueFromStringWithEncoding([self.value description], stringEncoding)];
}
}
@@ -212,9 +217,7 @@ @implementation AFHTTPClient
@synthesize networkReachabilityStatus = _networkReachabilityStatus;
@synthesize networkReachabilityStatusBlock = _networkReachabilityStatusBlock;
#endif
-#ifdef _AFNETWORKING_PIN_SSL_CERTIFICATES_
@synthesize defaultSSLPinningMode = _defaultSSLPinningMode;
-#endif
@synthesize allowsInvalidSSLCertificate = _allowsInvalidSSLCertificate;
+ (instancetype)clientWithBaseURL:(NSURL *)url {
@@ -256,15 +259,24 @@ - (id)initWithBaseURL:(NSURL *)url {
}];
[self setDefaultHeader:@"Accept-Language" value:[acceptLanguagesComponents componentsJoinedByString:@", "]];
+ NSString *userAgent = nil;
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wgnu"
#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
// User-Agent Header; see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.43
- [self setDefaultHeader:@"User-Agent" value:[NSString stringWithFormat:@"%@/%@ (%@; iOS %@; Scale/%0.2f)", [[[NSBundle mainBundle] infoDictionary] objectForKey:(__bridge NSString *)kCFBundleExecutableKey] ?: [[[NSBundle mainBundle] infoDictionary] objectForKey:(__bridge NSString *)kCFBundleIdentifierKey], (__bridge id)CFBundleGetValueForInfoDictionaryKey(CFBundleGetMainBundle(), kCFBundleVersionKey) ?: [[[NSBundle mainBundle] infoDictionary] objectForKey:(__bridge NSString *)kCFBundleVersionKey], [[UIDevice currentDevice] model], [[UIDevice currentDevice] systemVersion], ([[UIScreen mainScreen] respondsToSelector:@selector(scale)] ? [[UIScreen mainScreen] scale] : 1.0f)]];
+ userAgent = [NSString stringWithFormat:@"%@/%@ (%@; iOS %@; Scale/%0.2f)", [[[NSBundle mainBundle] infoDictionary] objectForKey:(__bridge NSString *)kCFBundleExecutableKey] ?: [[[NSBundle mainBundle] infoDictionary] objectForKey:(__bridge NSString *)kCFBundleIdentifierKey], (__bridge id)CFBundleGetValueForInfoDictionaryKey(CFBundleGetMainBundle(), kCFBundleVersionKey) ?: [[[NSBundle mainBundle] infoDictionary] objectForKey:(__bridge NSString *)kCFBundleVersionKey], [[UIDevice currentDevice] model], [[UIDevice currentDevice] systemVersion], ([[UIScreen mainScreen] respondsToSelector:@selector(scale)] ? [[UIScreen mainScreen] scale] : 1.0f)];
#elif defined(__MAC_OS_X_VERSION_MIN_REQUIRED)
- [self setDefaultHeader:@"User-Agent" value:[NSString stringWithFormat:@"%@/%@ (Mac OS X %@)", [[[NSBundle mainBundle] infoDictionary] objectForKey:(__bridge NSString *)kCFBundleExecutableKey] ?: [[[NSBundle mainBundle] infoDictionary] objectForKey:(__bridge NSString *)kCFBundleIdentifierKey], [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"] ?: [[[NSBundle mainBundle] infoDictionary] objectForKey:(__bridge NSString *)kCFBundleVersionKey], [[NSProcessInfo processInfo] operatingSystemVersionString]]];
+ userAgent = [NSString stringWithFormat:@"%@/%@ (Mac OS X %@)", [[[NSBundle mainBundle] infoDictionary] objectForKey:(__bridge NSString *)kCFBundleExecutableKey] ?: [[[NSBundle mainBundle] infoDictionary] objectForKey:(__bridge NSString *)kCFBundleIdentifierKey], [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"] ?: [[[NSBundle mainBundle] infoDictionary] objectForKey:(__bridge NSString *)kCFBundleVersionKey], [[NSProcessInfo processInfo] operatingSystemVersionString]];
#endif
#pragma clang diagnostic pop
+ if (userAgent) {
+ if (![userAgent canBeConvertedToEncoding:NSASCIIStringEncoding]) {
+ NSMutableString *mutableUserAgent = [userAgent mutableCopy];
+ CFStringTransform((__bridge CFMutableStringRef)(mutableUserAgent), NULL, kCFStringTransformToLatin, false);
+ userAgent = mutableUserAgent;
+ }
+ [self setDefaultHeader:@"User-Agent" value:userAgent];
+ }
#ifdef _SYSTEMCONFIGURATION_H
self.networkReachabilityStatus = AFNetworkReachabilityStatusUnknown;
@@ -479,10 +491,7 @@ - (NSMutableURLRequest *)requestWithMethod:(NSString *)method
break;
case AFJSONParameterEncoding:;
[request setValue:[NSString stringWithFormat:@"application/json; charset=%@", charset] forHTTPHeaderField:@"Content-Type"];
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wassign-enum"
- [request setHTTPBody:[NSJSONSerialization dataWithJSONObject:parameters options:0 error:&error]];
-#pragma clang diagnostic pop
+ [request setHTTPBody:[NSJSONSerialization dataWithJSONObject:parameters options:(NSJSONWritingOptions)0 error:&error]];
break;
case AFPropertyListParameterEncoding:;
[request setValue:[NSString stringWithFormat:@"application/x-plist; charset=%@", charset] forHTTPHeaderField:@"Content-Type"];
@@ -556,9 +565,7 @@ - (AFHTTPRequestOperation *)HTTPRequestOperationWithRequest:(NSURLRequest *)urlR
[operation setCompletionBlockWithSuccess:success failure:failure];
operation.credential = self.defaultCredential;
-#ifdef _AFNETWORKING_PIN_SSL_CERTIFICATES_
operation.SSLPinningMode = self.defaultSSLPinningMode;
-#endif
operation.allowsInvalidSSLCertificate = self.allowsInvalidSSLCertificate;
return operation;
@@ -739,8 +746,8 @@ - (id)copyWithZone:(NSZone *)zone {
HTTPClient.stringEncoding = self.stringEncoding;
HTTPClient.parameterEncoding = self.parameterEncoding;
- HTTPClient.registeredHTTPOperationClassNames = [self.registeredHTTPOperationClassNames copyWithZone:zone];
- HTTPClient.defaultHeaders = [self.defaultHeaders copyWithZone:zone];
+ HTTPClient.registeredHTTPOperationClassNames = [self.registeredHTTPOperationClassNames mutableCopyWithZone:zone];
+ HTTPClient.defaultHeaders = [self.defaultHeaders mutableCopyWithZone:zone];
#ifdef _SYSTEMCONFIGURATION_H
HTTPClient.networkReachabilityStatusBlock = self.networkReachabilityStatusBlock;
#endif
@@ -1058,21 +1065,31 @@ - (NSInteger)read:(uint8_t *)buffer
if ([self streamStatus] == NSStreamStatusClosed) {
return 0;
}
- NSInteger bytesRead = 0;
- while ((NSUInteger)bytesRead < MIN(length, self.numberOfBytesInPacket)) {
+ NSInteger totalNumberOfBytesRead = 0;
+
+ while ((NSUInteger)totalNumberOfBytesRead < MIN(length, self.numberOfBytesInPacket)) {
if (!self.currentHTTPBodyPart || ![self.currentHTTPBodyPart hasBytesAvailable]) {
if (!(self.currentHTTPBodyPart = [self.HTTPBodyPartEnumerator nextObject])) {
break;
}
} else {
- bytesRead += [self.currentHTTPBodyPart read:&buffer[bytesRead] maxLength:(length - (NSUInteger)bytesRead)];
- if (self.delay > 0.0f) {
- [NSThread sleepForTimeInterval:self.delay];
+ NSUInteger maxLength = length - (NSUInteger)totalNumberOfBytesRead;
+ NSInteger numberOfBytesRead = [self.currentHTTPBodyPart read:&buffer[totalNumberOfBytesRead] maxLength:maxLength];
+ if (numberOfBytesRead == -1) {
+ self.streamError = self.currentHTTPBodyPart.inputStream.streamError;
+ break;
+ } else {
+ totalNumberOfBytesRead += numberOfBytesRead;
+
+ if (self.delay > 0.0f) {
+ [NSThread sleepForTimeInterval:self.delay];
+ }
}
}
}
- return bytesRead;
+
+ return totalNumberOfBytesRead;
}
- (BOOL)getBuffer:(__unused uint8_t **)buffer
@@ -1277,34 +1294,39 @@ - (BOOL)hasBytesAvailable {
- (NSInteger)read:(uint8_t *)buffer
maxLength:(NSUInteger)length
{
- NSInteger bytesRead = 0;
+ NSUInteger totalNumberOfBytesRead = 0;
if (_phase == AFEncapsulationBoundaryPhase) {
NSData *encapsulationBoundaryData = [([self hasInitialBoundary] ? AFMultipartFormInitialBoundary() : AFMultipartFormEncapsulationBoundary()) dataUsingEncoding:self.stringEncoding];
- bytesRead += [self readData:encapsulationBoundaryData intoBuffer:&buffer[bytesRead] maxLength:(length - (NSUInteger)bytesRead)];
+ totalNumberOfBytesRead += [self readData:encapsulationBoundaryData intoBuffer:&buffer[totalNumberOfBytesRead] maxLength:(length - (NSUInteger)totalNumberOfBytesRead)];
}
if (_phase == AFHeaderPhase) {
NSData *headersData = [[self stringForHeaders] dataUsingEncoding:self.stringEncoding];
- bytesRead += [self readData:headersData intoBuffer:&buffer[bytesRead] maxLength:(length - (NSUInteger)bytesRead)];
+ totalNumberOfBytesRead += [self readData:headersData intoBuffer:&buffer[totalNumberOfBytesRead] maxLength:(length - (NSUInteger)totalNumberOfBytesRead)];
}
if (_phase == AFBodyPhase) {
- if ([self.inputStream hasBytesAvailable]) {
- bytesRead += [self.inputStream read:&buffer[bytesRead] maxLength:(length - (NSUInteger)bytesRead)];
- }
+ NSInteger numberOfBytesRead = 0;
+
+ numberOfBytesRead = [self.inputStream read:&buffer[totalNumberOfBytesRead] maxLength:(length - (NSUInteger)totalNumberOfBytesRead)];
+ if (numberOfBytesRead == -1) {
+ return -1;
+ } else {
+ totalNumberOfBytesRead += numberOfBytesRead;
- if (![self.inputStream hasBytesAvailable]) {
- [self transitionToNextPhase];
+ if ([self.inputStream streamStatus] >= NSStreamStatusAtEnd) {
+ [self transitionToNextPhase];
+ }
}
}
if (_phase == AFFinalBoundaryPhase) {
NSData *closingBoundaryData = ([self hasFinalBoundary] ? [AFMultipartFormFinalBoundary() dataUsingEncoding:self.stringEncoding] : [NSData data]);
- bytesRead += [self readData:closingBoundaryData intoBuffer:&buffer[bytesRead] maxLength:(length - (NSUInteger)bytesRead)];
+ totalNumberOfBytesRead += [self readData:closingBoundaryData intoBuffer:&buffer[totalNumberOfBytesRead] maxLength:(length - (NSUInteger)totalNumberOfBytesRead)];
}
- return bytesRead;
+ return totalNumberOfBytesRead;
}
- (NSInteger)readData:(NSData *)data
@@ -58,6 +58,10 @@
}
static void AFGetMediaTypeAndSubtypeWithString(NSString *string, NSString **type, NSString **subtype) {
+ if (!string) {
+ return;
+ }
+
NSScanner *scanner = [NSScanner scannerWithString:string];
[scanner setCharactersToBeSkipped:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
[scanner scanUpToString:@"/" intoString:type];
@@ -107,12 +111,14 @@ @interface AFHTTPRequestOperation ()
@property (readwrite, nonatomic, strong) NSURLRequest *request;
@property (readwrite, nonatomic, strong) NSHTTPURLResponse *response;
@property (readwrite, nonatomic, strong) NSError *HTTPError;
+@property (readwrite, nonatomic, strong) NSRecursiveLock *lock;
@end
@implementation AFHTTPRequestOperation
@synthesize HTTPError = _HTTPError;
@synthesize successCallbackQueue = _successCallbackQueue;
@synthesize failureCallbackQueue = _failureCallbackQueue;
+@dynamic lock;
@dynamic request;
@dynamic response;
@@ -133,6 +139,7 @@ - (void)dealloc {
}
- (NSError *)error {
+ [self.lock lock];
if (!self.HTTPError && self.response) {
if (![self hasAcceptableStatusCode] || ![self hasAcceptableContentType]) {
NSMutableDictionary *userInfo = [NSMutableDictionary dictionary];
@@ -154,6 +161,7 @@ - (NSError *)error {
}
}
}
+ [self.lock unlock];
if (self.HTTPError) {
return self.HTTPError;
Oops, something went wrong.

0 comments on commit 00fabc2

Please sign in to comment.