From c3c7aaad00faf279e1fb8a230a54c24336a2725d Mon Sep 17 00:00:00 2001 From: Pierre-Olivier Latour Date: Wed, 13 Mar 2019 13:40:16 -0700 Subject: [PATCH] Revert "Merge pull request #416 from melle/app-extensions" This reverts commit 8d0a3599ee304c2d0444521eb1765ec62eb01bae, reversing changes made to 7e4dd53c9837019be15688c6f46525d241494920. --- GCDWebServer/Core/GCDWebServer.m | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/GCDWebServer/Core/GCDWebServer.m b/GCDWebServer/Core/GCDWebServer.m index 57b6f33..e23fcb0 100644 --- a/GCDWebServer/Core/GCDWebServer.m +++ b/GCDWebServer/Core/GCDWebServer.m @@ -204,7 +204,7 @@ static void _ExecuteMainThreadRunLoopSources() { #endif } -#if TARGET_OS_IPHONE && !defined TARGET_OS_IPHONE_EXTENSION +#if TARGET_OS_IPHONE // Always called on main thread - (void)_startBackgroundTask { @@ -229,7 +229,7 @@ static void _ExecuteMainThreadRunLoopSources() { _connected = YES; GWS_LOG_DEBUG(@"Did connect"); -#if TARGET_OS_IPHONE && !defined TARGET_OS_IPHONE_EXTENSION +#if TARGET_OS_IPHONE if ([[UIApplication sharedApplication] applicationState] != UIApplicationStateBackground) { [self _startBackgroundTask]; } @@ -259,7 +259,7 @@ static void _ExecuteMainThreadRunLoopSources() { }); } -#if TARGET_OS_IPHONE && !defined TARGET_OS_IPHONE_EXTENSION +#if TARGET_OS_IPHONE // Always called on main thread - (void)_endBackgroundTask { @@ -283,7 +283,7 @@ static void _ExecuteMainThreadRunLoopSources() { _connected = NO; GWS_LOG_DEBUG(@"Did disconnect"); -#if TARGET_OS_IPHONE && !defined TARGET_OS_IPHONE_EXTENSION +#if TARGET_OS_IPHONE [self _endBackgroundTask]; #endif @@ -732,7 +732,7 @@ static inline NSString* _EncodeBase64(NSString* string) { - (BOOL)startWithOptions:(NSDictionary*)options error:(NSError**)error { if (_options == nil) { _options = options ? [options copy] : @{}; -#if TARGET_OS_IPHONE && !defined TARGET_OS_IPHONE_EXTENSION +#if TARGET_OS_IPHONE _suspendInBackground = [(NSNumber*)_GetOption(_options, GCDWebServerOption_AutomaticallySuspendInBackground, @YES) boolValue]; if (((_suspendInBackground == NO) || ([[UIApplication sharedApplication] applicationState] != UIApplicationStateBackground)) && ![self _start:error]) #else