add a 10-second timeout to the favicon request
This commit is contained in:
parent
e09b70afbb
commit
2433525e32
|
@ -958,7 +958,12 @@ typedef enum
|
|||
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
|
||||
|
||||
NSURL * favIconUrl = [NSURL URLWithString: [baseAddress stringByAppendingPathComponent: @"favicon.ico"]];
|
||||
NSImage * icon = [[NSImage alloc] initWithContentsOfURL: favIconUrl];
|
||||
|
||||
NSURLRequest * request = [NSURLRequest requestWithURL: favIconUrl cachePolicy: NSURLRequestUseProtocolCachePolicy
|
||||
timeoutInterval: 10.0];
|
||||
NSData * iconData = [NSURLConnection sendSynchronousRequest: request returningResponse: NULL error: NULL];
|
||||
NSImage * icon = [[NSImage alloc] initWithData: iconData];
|
||||
|
||||
if (icon)
|
||||
{
|
||||
[fTrackerIconCache setObject: icon forKey: baseAddress];
|
||||
|
|
Loading…
Reference in New Issue