Authored by Thomas Rasch

o Don't retry tile downloads after a HTTP 404

... ... @@ -28,6 +28,8 @@
#import "RMAbstractWebMapSource.h"
#import "RMTileCache.h"
#define HTTP_404_NOT_FOUND 404
@implementation RMAbstractWebMapSource
@synthesize retryCount, waitSeconds;
... ... @@ -143,9 +145,13 @@
{
for (NSUInteger try = 0; image == nil && try < self.retryCount; ++try)
{
NSHTTPURLResponse *response = nil;
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[URLs objectAtIndex:0]];
[request setTimeoutInterval:self.waitSeconds];
image = [UIImage imageWithData:[NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil]];
image = [UIImage imageWithData:[NSURLConnection sendSynchronousRequest:request returningResponse:&response error:nil]];
if (response.statusCode == HTTP_404_NOT_FOUND)
break;
}
}
... ...