Ben Copsey

* Use NSMakeCollectable instead so we can remove the casts

* Use [pool drain] because Xcode told us to
* Get rid of a couple of random nib warnings
... ... @@ -24,7 +24,7 @@
#import "ASIDataCompressor.h"
// Automatically set on build
NSString *ASIHTTPRequestVersion = @"v1.8.1-13 2011-08-06";
NSString *ASIHTTPRequestVersion = @"v1.8.1-23 2011-08-06";
static NSString *defaultUserAgent = nil;
... ... @@ -1169,7 +1169,7 @@ static NSOperationQueue *sharedQueue = nil;
} else {
[self setPostBodyReadStream:[ASIInputStream inputStreamWithFileAtPath:[self postBodyFilePath] request:self]];
}
[self setReadStream:[(NSInputStream *)CFMakeCollectable(CFReadStreamCreateForStreamedHTTPRequest(kCFAllocatorDefault, request,(CFReadStreamRef)[self postBodyReadStream])) autorelease]];
[self setReadStream:[NSMakeCollectable(CFReadStreamCreateForStreamedHTTPRequest(kCFAllocatorDefault, request,(CFReadStreamRef)[self postBodyReadStream])) autorelease]];
} else {
// If we have a request body, we'll stream it from memory using our custom stream, so that we can measure bandwidth use and it can be bandwidth-throttled if necessary
... ... @@ -1179,10 +1179,10 @@ static NSOperationQueue *sharedQueue = nil;
} else if ([self postBody]) {
[self setPostBodyReadStream:[ASIInputStream inputStreamWithData:[self postBody] request:self]];
}
[self setReadStream:[(NSInputStream *)CFMakeCollectable(CFReadStreamCreateForStreamedHTTPRequest(kCFAllocatorDefault, request,(CFReadStreamRef)[self postBodyReadStream])) autorelease]];
[self setReadStream:[NSMakeCollectable(CFReadStreamCreateForStreamedHTTPRequest(kCFAllocatorDefault, request,(CFReadStreamRef)[self postBodyReadStream])) autorelease]];
} else {
[self setReadStream:[(NSInputStream *)CFMakeCollectable(CFReadStreamCreateForHTTPRequest(kCFAllocatorDefault, request)) autorelease]];
[self setReadStream:[NSMakeCollectable(CFReadStreamCreateForHTTPRequest(kCFAllocatorDefault, request)) autorelease]];
}
}
... ... @@ -2132,9 +2132,9 @@ static NSOperationQueue *sharedQueue = nil;
}
#endif
[self setResponseHeaders:[(NSDictionary *)CFMakeCollectable(CFHTTPMessageCopyAllHeaderFields(message)) autorelease]];
[self setResponseHeaders:[NSMakeCollectable(CFHTTPMessageCopyAllHeaderFields(message)) autorelease]];
[self setResponseStatusCode:(int)CFHTTPMessageGetResponseStatusCode(message)];
[self setResponseStatusMessage:[(NSString *)CFMakeCollectable(CFHTTPMessageCopyResponseStatusLine(message)) autorelease]];
[self setResponseStatusMessage:[NSMakeCollectable(CFHTTPMessageCopyResponseStatusLine(message)) autorelease]];
if ([self downloadCache] && ([[self downloadCache] canUseCachedDataForRequest:self])) {
... ... @@ -2749,7 +2749,7 @@ static NSOperationQueue *sharedQueue = nil;
CFHTTPMessageRef responseHeader = (CFHTTPMessageRef) CFReadStreamCopyProperty((CFReadStreamRef)[self readStream],kCFStreamPropertyHTTPResponseHeader);
proxyAuthentication = CFHTTPAuthenticationCreateFromResponse(NULL, responseHeader);
CFRelease(responseHeader);
[self setProxyAuthenticationScheme:[(NSString *)CFMakeCollectable(CFHTTPAuthenticationCopyMethod(proxyAuthentication)) autorelease]];
[self setProxyAuthenticationScheme:[NSMakeCollectable(CFHTTPAuthenticationCopyMethod(proxyAuthentication)) autorelease]];
}
// If we haven't got a CFHTTPAuthenticationRef by now, something is badly wrong, so we'll have to give up
... ... @@ -2762,7 +2762,7 @@ static NSOperationQueue *sharedQueue = nil;
// Get the authentication realm
[self setProxyAuthenticationRealm:nil];
if (!CFHTTPAuthenticationRequiresAccountDomain(proxyAuthentication)) {
[self setProxyAuthenticationRealm:[(NSString *)CFMakeCollectable(CFHTTPAuthenticationCopyRealm(proxyAuthentication)) autorelease]];
[self setProxyAuthenticationRealm:[NSMakeCollectable(CFHTTPAuthenticationCopyRealm(proxyAuthentication)) autorelease]];
}
// See if authentication is valid
... ... @@ -2926,7 +2926,7 @@ static NSOperationQueue *sharedQueue = nil;
CFHTTPMessageRef responseHeader = (CFHTTPMessageRef) CFReadStreamCopyProperty((CFReadStreamRef)[self readStream],kCFStreamPropertyHTTPResponseHeader);
requestAuthentication = CFHTTPAuthenticationCreateFromResponse(NULL, responseHeader);
CFRelease(responseHeader);
[self setAuthenticationScheme:[(NSString *)CFMakeCollectable(CFHTTPAuthenticationCopyMethod(requestAuthentication)) autorelease]];
[self setAuthenticationScheme:[NSMakeCollectable(CFHTTPAuthenticationCopyMethod(requestAuthentication)) autorelease]];
}
if (!requestAuthentication) {
... ... @@ -2942,7 +2942,7 @@ static NSOperationQueue *sharedQueue = nil;
// Get the authentication realm
[self setAuthenticationRealm:nil];
if (!CFHTTPAuthenticationRequiresAccountDomain(requestAuthentication)) {
[self setAuthenticationRealm:[(NSString *)CFMakeCollectable(CFHTTPAuthenticationCopyRealm(requestAuthentication)) autorelease]];
[self setAuthenticationRealm:[NSMakeCollectable(CFHTTPAuthenticationCopyRealm(requestAuthentication)) autorelease]];
}
#if DEBUG_HTTP_AUTHENTICATION
... ... @@ -3159,7 +3159,7 @@ static NSOperationQueue *sharedQueue = nil;
if ([self complete] || [self isCancelled]) {
[[self cancelledLock] unlock];
[pool release];
[pool drain];
return;
}
... ... @@ -3196,7 +3196,7 @@ static NSOperationQueue *sharedQueue = nil;
}
CFRelease(self);
[pool release];
[pool drain];
}
- (BOOL)willAskDelegateToConfirmRedirect
... ... @@ -3507,13 +3507,16 @@ static NSOperationQueue *sharedQueue = nil;
// dealloc won't be called when running with GC, so we'll clean these up now
if (request) {
CFMakeCollectable(request);
CFRelease(request);
request = nil;
}
if (requestAuthentication) {
CFMakeCollectable(requestAuthentication);
CFRelease(requestAuthentication);
requestAuthentication = nil;
}
if (proxyAuthentication) {
CFMakeCollectable(proxyAuthentication);
CFRelease(proxyAuthentication);
proxyAuthentication = nil;
}
BOOL wasInProgress = inProgress;
... ... @@ -4771,7 +4774,7 @@ static NSOperationQueue *sharedQueue = nil;
while (runAlways) {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
CFRunLoopRun();
[pool release];
[pool drain];
}
// Should never be called, but anyway
... ...
This diff could not be displayed because it is too large.
This diff was suppressed by a .gitattributes entry.