mirror of
https://github.com/transmission/transmission.git
synced 2025-12-24 20:35:36 +00:00
add a 10-second timeout to the favicon request
This commit is contained in:
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user