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 @@ @@ -24,7 +24,7 @@
24 #import "ASIDataCompressor.h" 24 #import "ASIDataCompressor.h"
25 25
26 // Automatically set on build 26 // Automatically set on build
27 -NSString *ASIHTTPRequestVersion = @"v1.8.1-13 2011-08-06"; 27 +NSString *ASIHTTPRequestVersion = @"v1.8.1-23 2011-08-06";
28 28
29 static NSString *defaultUserAgent = nil; 29 static NSString *defaultUserAgent = nil;
30 30
@@ -1169,7 +1169,7 @@ static NSOperationQueue *sharedQueue = nil; @@ -1169,7 +1169,7 @@ static NSOperationQueue *sharedQueue = nil;
1169 } else { 1169 } else {
1170 [self setPostBodyReadStream:[ASIInputStream inputStreamWithFileAtPath:[self postBodyFilePath] request:self]]; 1170 [self setPostBodyReadStream:[ASIInputStream inputStreamWithFileAtPath:[self postBodyFilePath] request:self]];
1171 } 1171 }
1172 - [self setReadStream:[(NSInputStream *)CFMakeCollectable(CFReadStreamCreateForStreamedHTTPRequest(kCFAllocatorDefault, request,(CFReadStreamRef)[self postBodyReadStream])) autorelease]]; 1172 + [self setReadStream:[NSMakeCollectable(CFReadStreamCreateForStreamedHTTPRequest(kCFAllocatorDefault, request,(CFReadStreamRef)[self postBodyReadStream])) autorelease]];
1173 } else { 1173 } else {
1174 1174
1175 // 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 1175 // 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; @@ -1179,10 +1179,10 @@ static NSOperationQueue *sharedQueue = nil;
1179 } else if ([self postBody]) { 1179 } else if ([self postBody]) {
1180 [self setPostBodyReadStream:[ASIInputStream inputStreamWithData:[self postBody] request:self]]; 1180 [self setPostBodyReadStream:[ASIInputStream inputStreamWithData:[self postBody] request:self]];
1181 } 1181 }
1182 - [self setReadStream:[(NSInputStream *)CFMakeCollectable(CFReadStreamCreateForStreamedHTTPRequest(kCFAllocatorDefault, request,(CFReadStreamRef)[self postBodyReadStream])) autorelease]]; 1182 + [self setReadStream:[NSMakeCollectable(CFReadStreamCreateForStreamedHTTPRequest(kCFAllocatorDefault, request,(CFReadStreamRef)[self postBodyReadStream])) autorelease]];
1183 1183
1184 } else { 1184 } else {
1185 - [self setReadStream:[(NSInputStream *)CFMakeCollectable(CFReadStreamCreateForHTTPRequest(kCFAllocatorDefault, request)) autorelease]]; 1185 + [self setReadStream:[NSMakeCollectable(CFReadStreamCreateForHTTPRequest(kCFAllocatorDefault, request)) autorelease]];
1186 } 1186 }
1187 } 1187 }
1188 1188
@@ -2132,9 +2132,9 @@ static NSOperationQueue *sharedQueue = nil; @@ -2132,9 +2132,9 @@ static NSOperationQueue *sharedQueue = nil;
2132 } 2132 }
2133 #endif 2133 #endif
2134 2134
2135 - [self setResponseHeaders:[(NSDictionary *)CFMakeCollectable(CFHTTPMessageCopyAllHeaderFields(message)) autorelease]]; 2135 + [self setResponseHeaders:[NSMakeCollectable(CFHTTPMessageCopyAllHeaderFields(message)) autorelease]];
2136 [self setResponseStatusCode:(int)CFHTTPMessageGetResponseStatusCode(message)]; 2136 [self setResponseStatusCode:(int)CFHTTPMessageGetResponseStatusCode(message)];
2137 - [self setResponseStatusMessage:[(NSString *)CFMakeCollectable(CFHTTPMessageCopyResponseStatusLine(message)) autorelease]]; 2137 + [self setResponseStatusMessage:[NSMakeCollectable(CFHTTPMessageCopyResponseStatusLine(message)) autorelease]];
2138 2138
2139 if ([self downloadCache] && ([[self downloadCache] canUseCachedDataForRequest:self])) { 2139 if ([self downloadCache] && ([[self downloadCache] canUseCachedDataForRequest:self])) {
2140 2140
@@ -2749,7 +2749,7 @@ static NSOperationQueue *sharedQueue = nil; @@ -2749,7 +2749,7 @@ static NSOperationQueue *sharedQueue = nil;
2749 CFHTTPMessageRef responseHeader = (CFHTTPMessageRef) CFReadStreamCopyProperty((CFReadStreamRef)[self readStream],kCFStreamPropertyHTTPResponseHeader); 2749 CFHTTPMessageRef responseHeader = (CFHTTPMessageRef) CFReadStreamCopyProperty((CFReadStreamRef)[self readStream],kCFStreamPropertyHTTPResponseHeader);
2750 proxyAuthentication = CFHTTPAuthenticationCreateFromResponse(NULL, responseHeader); 2750 proxyAuthentication = CFHTTPAuthenticationCreateFromResponse(NULL, responseHeader);
2751 CFRelease(responseHeader); 2751 CFRelease(responseHeader);
2752 - [self setProxyAuthenticationScheme:[(NSString *)CFMakeCollectable(CFHTTPAuthenticationCopyMethod(proxyAuthentication)) autorelease]]; 2752 + [self setProxyAuthenticationScheme:[NSMakeCollectable(CFHTTPAuthenticationCopyMethod(proxyAuthentication)) autorelease]];
2753 } 2753 }
2754 2754
2755 // If we haven't got a CFHTTPAuthenticationRef by now, something is badly wrong, so we'll have to give up 2755 // 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; @@ -2762,7 +2762,7 @@ static NSOperationQueue *sharedQueue = nil;
2762 // Get the authentication realm 2762 // Get the authentication realm
2763 [self setProxyAuthenticationRealm:nil]; 2763 [self setProxyAuthenticationRealm:nil];
2764 if (!CFHTTPAuthenticationRequiresAccountDomain(proxyAuthentication)) { 2764 if (!CFHTTPAuthenticationRequiresAccountDomain(proxyAuthentication)) {
2765 - [self setProxyAuthenticationRealm:[(NSString *)CFMakeCollectable(CFHTTPAuthenticationCopyRealm(proxyAuthentication)) autorelease]]; 2765 + [self setProxyAuthenticationRealm:[NSMakeCollectable(CFHTTPAuthenticationCopyRealm(proxyAuthentication)) autorelease]];
2766 } 2766 }
2767 2767
2768 // See if authentication is valid 2768 // See if authentication is valid
@@ -2926,7 +2926,7 @@ static NSOperationQueue *sharedQueue = nil; @@ -2926,7 +2926,7 @@ static NSOperationQueue *sharedQueue = nil;
2926 CFHTTPMessageRef responseHeader = (CFHTTPMessageRef) CFReadStreamCopyProperty((CFReadStreamRef)[self readStream],kCFStreamPropertyHTTPResponseHeader); 2926 CFHTTPMessageRef responseHeader = (CFHTTPMessageRef) CFReadStreamCopyProperty((CFReadStreamRef)[self readStream],kCFStreamPropertyHTTPResponseHeader);
2927 requestAuthentication = CFHTTPAuthenticationCreateFromResponse(NULL, responseHeader); 2927 requestAuthentication = CFHTTPAuthenticationCreateFromResponse(NULL, responseHeader);
2928 CFRelease(responseHeader); 2928 CFRelease(responseHeader);
2929 - [self setAuthenticationScheme:[(NSString *)CFMakeCollectable(CFHTTPAuthenticationCopyMethod(requestAuthentication)) autorelease]]; 2929 + [self setAuthenticationScheme:[NSMakeCollectable(CFHTTPAuthenticationCopyMethod(requestAuthentication)) autorelease]];
2930 } 2930 }
2931 2931
2932 if (!requestAuthentication) { 2932 if (!requestAuthentication) {
@@ -2942,7 +2942,7 @@ static NSOperationQueue *sharedQueue = nil; @@ -2942,7 +2942,7 @@ static NSOperationQueue *sharedQueue = nil;
2942 // Get the authentication realm 2942 // Get the authentication realm
2943 [self setAuthenticationRealm:nil]; 2943 [self setAuthenticationRealm:nil];
2944 if (!CFHTTPAuthenticationRequiresAccountDomain(requestAuthentication)) { 2944 if (!CFHTTPAuthenticationRequiresAccountDomain(requestAuthentication)) {
2945 - [self setAuthenticationRealm:[(NSString *)CFMakeCollectable(CFHTTPAuthenticationCopyRealm(requestAuthentication)) autorelease]]; 2945 + [self setAuthenticationRealm:[NSMakeCollectable(CFHTTPAuthenticationCopyRealm(requestAuthentication)) autorelease]];
2946 } 2946 }
2947 2947
2948 #if DEBUG_HTTP_AUTHENTICATION 2948 #if DEBUG_HTTP_AUTHENTICATION
@@ -3159,7 +3159,7 @@ static NSOperationQueue *sharedQueue = nil; @@ -3159,7 +3159,7 @@ static NSOperationQueue *sharedQueue = nil;
3159 3159
3160 if ([self complete] || [self isCancelled]) { 3160 if ([self complete] || [self isCancelled]) {
3161 [[self cancelledLock] unlock]; 3161 [[self cancelledLock] unlock];
3162 - [pool release]; 3162 + [pool drain];
3163 return; 3163 return;
3164 } 3164 }
3165 3165
@@ -3196,7 +3196,7 @@ static NSOperationQueue *sharedQueue = nil; @@ -3196,7 +3196,7 @@ static NSOperationQueue *sharedQueue = nil;
3196 } 3196 }
3197 3197
3198 CFRelease(self); 3198 CFRelease(self);
3199 - [pool release]; 3199 + [pool drain];
3200 } 3200 }
3201 3201
3202 - (BOOL)willAskDelegateToConfirmRedirect 3202 - (BOOL)willAskDelegateToConfirmRedirect
@@ -3507,13 +3507,16 @@ static NSOperationQueue *sharedQueue = nil; @@ -3507,13 +3507,16 @@ static NSOperationQueue *sharedQueue = nil;
3507 3507
3508 // dealloc won't be called when running with GC, so we'll clean these up now 3508 // dealloc won't be called when running with GC, so we'll clean these up now
3509 if (request) { 3509 if (request) {
3510 - CFMakeCollectable(request); 3510 + CFRelease(request);
  3511 + request = nil;
3511 } 3512 }
3512 if (requestAuthentication) { 3513 if (requestAuthentication) {
3513 - CFMakeCollectable(requestAuthentication); 3514 + CFRelease(requestAuthentication);
  3515 + requestAuthentication = nil;
3514 } 3516 }
3515 if (proxyAuthentication) { 3517 if (proxyAuthentication) {
3516 - CFMakeCollectable(proxyAuthentication); 3518 + CFRelease(proxyAuthentication);
  3519 + proxyAuthentication = nil;
3517 } 3520 }
3518 3521
3519 BOOL wasInProgress = inProgress; 3522 BOOL wasInProgress = inProgress;
@@ -4771,7 +4774,7 @@ static NSOperationQueue *sharedQueue = nil; @@ -4771,7 +4774,7 @@ static NSOperationQueue *sharedQueue = nil;
4771 while (runAlways) { 4774 while (runAlways) {
4772 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 4775 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
4773 CFRunLoopRun(); 4776 CFRunLoopRun();
4774 - [pool release]; 4777 + [pool drain];
4775 } 4778 }
4776 4779
4777 // Should never be called, but anyway 4780 // 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.