Permalink
Browse files

[Network] adapted airportyh's fix to changes introduced since.

  • Loading branch information...
tonklon committed Jan 7, 2012
1 parent 79a554b commit ef7f52f1ee0a531db6fb821cd2567153a05481a1
Showing with 6 additions and 7 deletions.
  1. +6 −7 src/Three20Network/Sources/TTRequestLoader.m
@@ -256,7 +256,7 @@ - (NSError*)processResponse:(NSHTTPURLResponse*)response data:(id)data {
for (TTURLRequest* request in _requests) {
NSError* error = nil;
// We need to accept valid HTTP status codes, not only 200.
- if (!response
+ if (!response || ![response respondsToSelector:@selector(statusCode)]
|| (response.statusCode >= 200 && response.statusCode < 300)
|| response.statusCode == 304) {
error = [request.response request:request processResponse:response data:data];
@@ -359,15 +359,14 @@ - (void)connection:(NSURLConnection*)connection didReceiveResponse:(NSHTTPURLRes
}
_responseData = [[NSMutableData alloc] initWithCapacity:contentLength];
+
+ for (TTURLRequest* request in [[_requests copy] autorelease]) {
+ request.totalContentLength = contentLength;
+ }
+
}else {
_responseData = [[NSMutableData alloc] init];
}
-
-
- for (TTURLRequest* request in [[_requests copy] autorelease]) {
- request.totalContentLength = contentLength;
- }
-
}

0 comments on commit ef7f52f

Please sign in to comment.