Permalink
Browse files

Cancel head fetching to please 10.5.

  • Loading branch information...
1 parent aaa5541 commit 71a30dd730a590ff1b983bee21041466dffe1cd2 @ssp ssp committed Oct 8, 2009
Showing with 6 additions and 1 deletion.
  1. +6 −1 Plugin/CTFLoader.m
View
@@ -59,7 +59,6 @@ - (void) start {
- (void) finish {
- [[self retain] autorelease];
[delegate performSelector:callbackSelector withObject:self];
}
@@ -86,6 +85,12 @@ - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *) newDa
- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSHTTPURLResponse *)theResponse {
[self setResponse: theResponse];
+
+ // We need to cancel HEAD fetching connections here as 10.5 may proceed to download the whole file otherwise (http://openradar.appspot.com/7019347)
+ if ( [self HEADOnly] && [theResponse statusCode] == 200 ) {
+ [self finish];
+ [connection cancel];
+ }
}

0 comments on commit 71a30dd

Please sign in to comment.