From: Benjamin R. <be...@us...> - 2004-03-27 21:03:29
|
Update of /cvsroot/ljkit/LJKit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9947 Modified Files: LJServer.m LJServer.h Log Message: Moved the MAC_OS_X_VERSION_MIN_REQUIRED macros around a bit. Too much was being excluded from Jaguar. All the proxy code is safe for Jaguar, it was only the reachability monitoring code that needed to be cordoned off. This might fix the proxy troubles in Xjournal. Fraser, you'll have to test it because I don't have a proxy or the 10.2 SDK installed. (I just successfully compiled all of LJKit with 10.1 as the deployment target; I don't know if that is a good or bad sign.) Index: LJServer.h =================================================================== RCS file: /cvsroot/ljkit/LJKit/LJServer.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** LJServer.h 16 Mar 2004 02:54:35 -0000 1.4 --- LJServer.h 27 Mar 2004 20:52:19 -0000 1.5 *************** *** 32,35 **** --- 32,36 ---- @class LJAccount; + #if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_3 /*! @const LJServerReachabilityDidChangeNotification *************** *** 51,54 **** --- 52,56 ---- */ FOUNDATION_EXPORT NSString * const LJServerReachabilityDidChangeNotification; + #endif /*! *************** *** 102,122 **** - (BOOL)isUsingFastServers; /*! @method enableReachabilityMonitoring @abstract Enables reachability monitoring. @discussion ! Description forthcoming. */ - #if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_3 - (void)enableReachabilityMonitoring; #endif /*! @method disableReachabilityMonitoring @abstract Disables reachability monitoring. @discussion ! Description forthcoming. */ - #if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_3 - (void)disableReachabilityMonitoring; #endif --- 104,132 ---- - (BOOL)isUsingFastServers; + #if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_3 /*! @method enableReachabilityMonitoring @abstract Enables reachability monitoring. @discussion ! When monitoring is enabled, LJKit posts ! LJServerReachabilityDidChangeNotification every time the reachability of the ! server changes for some reason. You can call getReachability: to determine ! the reachability of the server. ! Monitoring is only available on Mac OS X 10.3 or later. */ - (void)enableReachabilityMonitoring; #endif + #if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_3 /*! @method disableReachabilityMonitoring @abstract Disables reachability monitoring. @discussion ! When monitoring is enabled, LJKit posts ! LJServerReachabilityDidChangeNotification every time the reachability of the ! server changes for some reason. You can call getReachability: to determine ! the reachability of the server. ! Monitoring is only available on Mac OS X 10.3 or later. */ - (void)disableReachabilityMonitoring; #endif Index: LJServer.m =================================================================== RCS file: /cvsroot/ljkit/LJKit/LJServer.m,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** LJServer.m 16 Mar 2004 02:54:35 -0000 1.6 --- LJServer.m 27 Mar 2004 20:52:19 -0000 1.7 *************** *** 32,57 **** #import "URLEncoding.h" NSString * const LJServerReachabilityDidChangeNotification = @"LJServerReachabilityDidChange"; static NSString * gUserAgent = nil; ! #if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_3 static unsigned int gStoreRefCount = 0; static SCDynamicStoreRef gStore = NULL; static SCDynamicStoreContext gStoreContext; static CFRunLoopSourceRef gRunLoopSource = NULL; - #endif static CFDictionaryRef gProxyInfo = NULL; - #if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_3 void LJServerStoreCallback(SCDynamicStoreRef store, CFArrayRef changedKeys, void *info); void LJServerReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkConnectionFlags flags, void *info); #endif @interface LJServer (ClassPrivate) - #if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_3 - (void)enableProxyDetection; - (void)disableProxyDetection; - #endif - (void)updateRequestTemplate; @end --- 32,57 ---- #import "URLEncoding.h" + #if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_3 NSString * const LJServerReachabilityDidChangeNotification = @"LJServerReachabilityDidChange"; + #endif static NSString * gUserAgent = nil; ! // Globals Required for Proxy Detection static unsigned int gStoreRefCount = 0; static SCDynamicStoreRef gStore = NULL; static SCDynamicStoreContext gStoreContext; static CFRunLoopSourceRef gRunLoopSource = NULL; static CFDictionaryRef gProxyInfo = NULL; void LJServerStoreCallback(SCDynamicStoreRef store, CFArrayRef changedKeys, void *info); + + #if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_3 void LJServerReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkConnectionFlags flags, void *info); #endif @interface LJServer (ClassPrivate) - (void)enableProxyDetection; - (void)disableProxyDetection; - (void)updateRequestTemplate; @end *************** *** 76,82 **** _account = account; // don't retain (to avoid a cycle) [self setURL:url]; - #if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_3 [self enableProxyDetection]; - #endif } return self; --- 76,80 ---- *************** *** 90,95 **** #if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_3 [self disableReachabilityMonitoring]; - [self disableProxyDetection]; #endif [super dealloc]; } --- 88,93 ---- #if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_3 [self disableReachabilityMonitoring]; #endif + [self disableProxyDetection]; [super dealloc]; } *************** *** 118,125 **** if (_requestTemplate) CFRelease(_requestTemplate); _requestTemplate = NULL; - // If we were monitoring reachability, the target needs to be updated. - /* disabled for now. Jag compat. */ #if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_3 ! if (_target != NULL) { [self disableReachabilityMonitoring]; [self enableReachabilityMonitoring]; --- 116,122 ---- if (_requestTemplate) CFRelease(_requestTemplate); _requestTemplate = NULL; #if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_3 ! // If we were monitoring reachability, the target needs to be updated. ! if (_target != NULL) { [self disableReachabilityMonitoring]; [self enableReachabilityMonitoring]; *************** *** 155,159 **** } - #if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_3 - (void)enableProxyDetection { --- 152,155 ---- *************** *** 189,192 **** --- 185,189 ---- } + #if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_3 - (void)enableReachabilityMonitoring { *************** *** 198,202 **** --- 195,201 ---- } } + #endif + #if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_3 - (void)disableReachabilityMonitoring { *************** *** 320,322 **** [userInfo release]; } ! #endif \ No newline at end of file --- 319,321 ---- [userInfo release]; } ! #endif |