Merge pull request #1077 from AFNetworking/experimental-simplified-network-thread-entry-point

Simplifying Network Thread Entry Point
This commit is contained in:
Mattt Thompson 2013-06-20 09:15:04 -07:00
Родитель d0d4c58bb8 bc8fcee718
Коммит d492c4bff5
3 изменённых файлов: 12 добавлений и 9 удалений

Просмотреть файл

@ -186,13 +186,14 @@ static BOOL AFSecKeyIsEqualToKey(SecKeyRef key1, SecKeyRef key2) {
@synthesize redirectResponse = _redirectResponse;
@synthesize lock = _lock;
+ (void) __attribute__((noreturn)) networkRequestThreadEntryPoint:(id)__unused object {
do {
@autoreleasepool {
[[NSThread currentThread] setName:@"AFNetworking"];
[[NSRunLoop currentRunLoop] run];
}
} while (YES);
+ (void)networkRequestThreadEntryPoint:(id)__unused object {
@autoreleasepool {
[[NSThread currentThread] setName:@"AFNetworking"];
NSRunLoop *runLoop = [NSRunLoop currentRunLoop];
[runLoop addPort:[NSMachPort port] forMode:NSDefaultRunLoopMode];
[runLoop run];
}
}
+ (NSThread *)networkRequestThread {

Просмотреть файл

@ -325,7 +325,7 @@
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_ENTITLEMENTS = "AFNetworking Example.entitlements";
CODE_SIGN_IDENTITY = "Mac Developer";
CODE_SIGN_IDENTITY = "";
COMBINE_HIDPI_IMAGES = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = Prefix.pch;
@ -339,7 +339,7 @@
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_ENTITLEMENTS = "AFNetworking Example.entitlements";
CODE_SIGN_IDENTITY = "Mac Developer";
CODE_SIGN_IDENTITY = "";
COMBINE_HIDPI_IMAGES = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = Prefix.pch;

Просмотреть файл

@ -53,6 +53,8 @@ static NSString * const kAFAppDotNetAPIBaseURLString = @"https://alpha-api.app.n
if ([[url scheme] isEqualToString:@"https"] && [[url host] isEqualToString:@"alpha-api.app.net"]) {
[self setDefaultSSLPinningMode:AFSSLPinningModePublicKey];
}
self.defaultSSLPinningMode = AFSSLPinningModeNone;
return self;
}