Ben Copsey

Merge branch 'master' of github.com:pokeb/asi-http-request

... ... @@ -10,3 +10,4 @@ profile
*.pbxuser
*.mode1v3
External/GHUnit/*
.svn
\ No newline at end of file
... ...
... ... @@ -189,7 +189,7 @@
// Make sure nothing went wrong
if ([inputStream streamStatus] == NSStreamEventErrorOccurred) {
if (err) {
*err = [NSError errorWithDomain:NetworkRequestErrorDomain code:ASICompressionError userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSString stringWithFormat:@"Compression of %@ failed because we were unable to write to the destination data file at &@",sourcePath,destinationPath],NSLocalizedDescriptionKey,[outputStream streamError],NSUnderlyingErrorKey,nil]];
*err = [NSError errorWithDomain:NetworkRequestErrorDomain code:ASICompressionError userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSString stringWithFormat:@"Compression of %@ failed because we were unable to write to the destination data file at %@",sourcePath,destinationPath],NSLocalizedDescriptionKey,[outputStream streamError],NSUnderlyingErrorKey,nil]];
}
[compressor closeStream];
return NO;
... ...
... ... @@ -186,7 +186,7 @@
// Make sure nothing went wrong
if ([inputStream streamStatus] == NSStreamEventErrorOccurred) {
if (err) {
*err = [NSError errorWithDomain:NetworkRequestErrorDomain code:ASICompressionError userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSString stringWithFormat:@"Decompression of %@ failed because we were unable to write to the destination data file at &@",sourcePath,destinationPath],NSLocalizedDescriptionKey,[outputStream streamError],NSUnderlyingErrorKey,nil]];
*err = [NSError errorWithDomain:NetworkRequestErrorDomain code:ASICompressionError userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSString stringWithFormat:@"Decompression of %@ failed because we were unable to write to the destination data file at %@",sourcePath,destinationPath],NSLocalizedDescriptionKey,[outputStream streamError],NSUnderlyingErrorKey,nil]];
}
[decompressor closeStream];
return NO;
... ...
... ... @@ -105,7 +105,7 @@ static BOOL isBandwidthThrottled = NO;
// When YES, bandwidth will be automatically throttled when using WWAN (3G/Edge/GPRS)
// Wifi will not be throttled
static BOOL shouldThrottleBandwithForWWANOnly = NO;
static BOOL shouldThrottleBandwidthForWWANOnly = NO;
#endif
// Mediates access to the session cookies so requests
... ... @@ -4080,6 +4080,7 @@ static NSOperationQueue *sharedQueue = nil;
[newRequest setShouldUseRFC2616RedirectBehaviour:[self shouldUseRFC2616RedirectBehaviour]];
[newRequest setShouldAttemptPersistentConnection:[self shouldAttemptPersistentConnection]];
[newRequest setPersistentConnectionTimeoutSeconds:[self persistentConnectionTimeoutSeconds]];
[newRequest setAuthenticationScheme:[self authenticationScheme]];
return newRequest;
}
... ... @@ -4492,7 +4493,7 @@ static NSOperationQueue *sharedQueue = nil;
#if TARGET_OS_IPHONE
[bandwidthThrottlingLock lock];
BOOL throttle = isBandwidthThrottled || (!shouldThrottleBandwithForWWANOnly && (maxBandwidthPerSecond > 0));
BOOL throttle = isBandwidthThrottled || (!shouldThrottleBandwidthForWWANOnly && (maxBandwidthPerSecond > 0));
[bandwidthThrottlingLock unlock];
return throttle;
#else
... ... @@ -4572,7 +4573,7 @@ static NSOperationQueue *sharedQueue = nil;
// Are we performing bandwidth throttling?
if (
#if TARGET_OS_IPHONE
isBandwidthThrottled || (!shouldThrottleBandwithForWWANOnly && (maxBandwidthPerSecond))
isBandwidthThrottled || (!shouldThrottleBandwidthForWWANOnly && (maxBandwidthPerSecond))
#else
maxBandwidthPerSecond
#endif
... ... @@ -4624,7 +4625,7 @@ static NSOperationQueue *sharedQueue = nil;
[ASIHTTPRequest setMaxBandwidthPerSecond:0];
[bandwidthThrottlingLock lock];
isBandwidthThrottled = NO;
shouldThrottleBandwithForWWANOnly = NO;
shouldThrottleBandwidthForWWANOnly = NO;
[bandwidthThrottlingLock unlock];
}
}
... ... @@ -4632,7 +4633,7 @@ static NSOperationQueue *sharedQueue = nil;
+ (void)throttleBandwidthForWWANUsingLimit:(unsigned long)limit
{
[bandwidthThrottlingLock lock];
shouldThrottleBandwithForWWANOnly = YES;
shouldThrottleBandwidthForWWANOnly = YES;
maxBandwidthPerSecond = limit;
[ASIHTTPRequest registerForNetworkReachabilityNotifications];
[bandwidthThrottlingLock unlock];
... ...
... ... @@ -22,6 +22,9 @@
-(void) dealloc {
[name release];
[cdnURL release];
[referrerACL release];
[useragentACL release];
[super dealloc];
}
... ...
... ... @@ -29,4 +29,13 @@
@synthesize creationDate;
@synthesize ownerID;
@synthesize ownerName;
- (void)dealloc
{
[name release];
[creationDate release];
[ownerID release];
[ownerName release];
}
@end
... ...
... ... @@ -115,6 +115,12 @@
}
}
- (void)dealloc
{
[popoverController release];
[rootPopoverButtonItem release];
[super dealloc];
}
@synthesize splitViewController;
@synthesize popoverController;
... ...