Skip to content

Commit 15d05f1

Browse files
Brian Mortonblakewatters
Brian Morton
authored andcommitted
Move the invalidateTimeoutTimer call in RKResponse from didReceiveData to didReceiveResponse and didFailWithError so we are sure its always called and as early as possible.
1 parent 2385814 commit 15d05f1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Code/Network/RKResponse.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSHTTPURLRe
189189
RKLogDebug(@"NSHTTPURLResponse Status Code: %ld", (long) [response statusCode]);
190190
RKLogDebug(@"Headers: %@", [response allHeaderFields]);
191191
_httpURLResponse = [response retain];
192+
[_request invalidateTimeoutTimer];
192193
}
193194

194195
- (void)connectionDidFinishLoading:(NSURLConnection *)connection {
@@ -199,6 +200,7 @@ - (void)connectionDidFinishLoading:(NSURLConnection *)connection {
199200
- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error {
200201
_failureError = [error retain];
201202
[_request didFailLoadWithError:_failureError];
203+
[_request invalidateTimeoutTimer];
202204
}
203205

204206
- (NSInputStream *)connection:(NSURLConnection *)connection needNewBodyStream:(NSURLRequest *)request {

0 commit comments

Comments
 (0)