Fix AutoRecoveringHttpDataSource raising even with wrong source ref

This commit is contained in:
Thong Nguyen 2013-11-18 16:01:41 +00:00
parent 8e90aed1a1
commit d76c1c2160
1 changed files with 5 additions and 5 deletions

View File

@ -190,7 +190,7 @@ static void ReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkReach
if (!(self.innerDataSource.httpStatusCode >= 200 && self.innerDataSource.httpStatusCode <= 299) && reconnectAttempts >= MAX_ATTEMPTS_WITH_SERVER_ERROR)
{
[self.delegate dataSourceErrorOccured:self];
[super dataSourceErrorOccured:self];
}
else if (reconnectAttempts > MAX_IMMEDIATE_RECONNECT_ATTEMPTS)
{
@ -211,26 +211,26 @@ static void ReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkReach
return;
}
[self.delegate dataSourceEof:dataSource];
[self.delegate dataSourceEof:self];
}
-(void) dataSourceErrorOccured:(DataSource*)dataSource
{
if (self.innerDataSource.httpStatusCode == 416 /* Range out of bounds */)
{
[self.delegate dataSourceEof:dataSource];
[super dataSourceEof:dataSource];
}
else
{
[self processRetryOnError];
}
}
-(NSString*) description
{
return [NSString stringWithFormat:@"Auto-recovering HTTP data source with file length: %lld and position: %lld", self.length, self.position];
}
@end