adium 2350:07b7b2f9f71c: Fix trying to grab the proxy auto-confi...

commits at adium.im commits at adium.im
Wed May 27 22:55:33 UTC 2009


details:	http://hg.adium.im/adium/rev/07b7b2f9f71c
revision:	2350:07b7b2f9f71c
author:		Zachary West <zacw at adium.im>
date:		Wed May 27 18:55:18 2009 -0400

Fix trying to grab the proxy auto-config file. Fixes #12199.

CFNetworkCopyProxiesForAutoConfigurationScript requires its CFErrorRef be non-NULL, so pass it a valid one, and echo out any errors we do receive, as a bonus.

diffstat:

 ChangeLogs/Changes Between Betas.txt                              |   1 +
 Frameworks/AIUtilities Framework/Source/AISystemNetworkDefaults.m |  15 ++++++-
 2 files changed, 14 insertions(+), 2 deletions(-)

diffs (36 lines):

diff -r 81a4ea06e535 -r 07b7b2f9f71c ChangeLogs/Changes Between Betas.txt
--- a/ChangeLogs/Changes Between Betas.txt	Wed May 27 18:33:51 2009 -0400
+++ b/ChangeLogs/Changes Between Betas.txt	Wed May 27 18:55:18 2009 -0400
@@ -2,6 +2,7 @@
  * Fixed a crash due to debug code accidentally left in b4.
  * Fixed a crash/hang when moving a contact from a meta contact into a group.
  * Fixed a crash caused by setting the status message via AppleScript (#12219).
+ * Fixed a crash when using a Proxy Auto-Config (PAC) file. (#12199)
  * Fixed indeterminate errors if you provide a space in an IRC account's NickServ password.
  * Fixed retweeting or deleting tweets featuring any of: ;/?:@&=+$, (#12217)
  * Changed behavior when moving a contact between groups, fixing a bug in protocols which don't support multiple groups.
diff -r 81a4ea06e535 -r 07b7b2f9f71c Frameworks/AIUtilities Framework/Source/AISystemNetworkDefaults.m
--- a/Frameworks/AIUtilities Framework/Source/AISystemNetworkDefaults.m	Wed May 27 18:33:51 2009 -0400
+++ b/Frameworks/AIUtilities Framework/Source/AISystemNetworkDefaults.m	Wed May 27 18:55:18 2009 -0400
@@ -131,8 +131,19 @@
 						// that is required by CFNetworkCopyProxiesForAutoConfigurationScript.
 						CFRelease(CFNetworkCopyProxiesForURL(url, NULL));
 						
-						proxies = [(NSArray *)CFNetworkCopyProxiesForAutoConfigurationScript((CFStringRef)scriptStr, url, NULL) autorelease];
-						if (proxies && proxies.count) {
+						CFErrorRef error = NULL;
+						proxies = [(NSArray *)CFNetworkCopyProxiesForAutoConfigurationScript((CFStringRef)scriptStr, url, &error) autorelease];						
+						if (error) {
+							CFStringRef description = CFErrorCopyDescription(error);
+							
+							NSLog(@"Tried to get PAC, but got error: %@ %d %@",
+								  CFErrorGetDomain(error),
+								  CFErrorGetCode(error),
+								  description);
+							
+							CFRelease(description);
+							CFRelease(error);
+						} else if (proxies && proxies.count) {
 							proxyDict = [proxies objectAtIndex:0];
 							
 							systemProxySettingsDictionary = [NSMutableDictionary dictionaryWithObjectsAndKeys:




More information about the commits mailing list