Ben Copsey

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

@@ -10,3 +10,4 @@ profile @@ -10,3 +10,4 @@ profile
10 *.pbxuser 10 *.pbxuser
11 *.mode1v3 11 *.mode1v3
12 External/GHUnit/* 12 External/GHUnit/*
  13 +.svn
@@ -189,7 +189,7 @@ @@ -189,7 +189,7 @@
189 // Make sure nothing went wrong 189 // Make sure nothing went wrong
190 if ([inputStream streamStatus] == NSStreamEventErrorOccurred) { 190 if ([inputStream streamStatus] == NSStreamEventErrorOccurred) {
191 if (err) { 191 if (err) {
192 - *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]]; 192 + *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]];
193 } 193 }
194 [compressor closeStream]; 194 [compressor closeStream];
195 return NO; 195 return NO;
@@ -186,7 +186,7 @@ @@ -186,7 +186,7 @@
186 // Make sure nothing went wrong 186 // Make sure nothing went wrong
187 if ([inputStream streamStatus] == NSStreamEventErrorOccurred) { 187 if ([inputStream streamStatus] == NSStreamEventErrorOccurred) {
188 if (err) { 188 if (err) {
189 - *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]]; 189 + *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]];
190 } 190 }
191 [decompressor closeStream]; 191 [decompressor closeStream];
192 return NO; 192 return NO;
@@ -105,7 +105,7 @@ static BOOL isBandwidthThrottled = NO; @@ -105,7 +105,7 @@ static BOOL isBandwidthThrottled = NO;
105 105
106 // When YES, bandwidth will be automatically throttled when using WWAN (3G/Edge/GPRS) 106 // When YES, bandwidth will be automatically throttled when using WWAN (3G/Edge/GPRS)
107 // Wifi will not be throttled 107 // Wifi will not be throttled
108 -static BOOL shouldThrottleBandwithForWWANOnly = NO; 108 +static BOOL shouldThrottleBandwidthForWWANOnly = NO;
109 #endif 109 #endif
110 110
111 // Mediates access to the session cookies so requests 111 // Mediates access to the session cookies so requests
@@ -4080,6 +4080,7 @@ static NSOperationQueue *sharedQueue = nil; @@ -4080,6 +4080,7 @@ static NSOperationQueue *sharedQueue = nil;
4080 [newRequest setShouldUseRFC2616RedirectBehaviour:[self shouldUseRFC2616RedirectBehaviour]]; 4080 [newRequest setShouldUseRFC2616RedirectBehaviour:[self shouldUseRFC2616RedirectBehaviour]];
4081 [newRequest setShouldAttemptPersistentConnection:[self shouldAttemptPersistentConnection]]; 4081 [newRequest setShouldAttemptPersistentConnection:[self shouldAttemptPersistentConnection]];
4082 [newRequest setPersistentConnectionTimeoutSeconds:[self persistentConnectionTimeoutSeconds]]; 4082 [newRequest setPersistentConnectionTimeoutSeconds:[self persistentConnectionTimeoutSeconds]];
  4083 + [newRequest setAuthenticationScheme:[self authenticationScheme]];
4083 return newRequest; 4084 return newRequest;
4084 } 4085 }
4085 4086
@@ -4492,7 +4493,7 @@ static NSOperationQueue *sharedQueue = nil; @@ -4492,7 +4493,7 @@ static NSOperationQueue *sharedQueue = nil;
4492 #if TARGET_OS_IPHONE 4493 #if TARGET_OS_IPHONE
4493 [bandwidthThrottlingLock lock]; 4494 [bandwidthThrottlingLock lock];
4494 4495
4495 - BOOL throttle = isBandwidthThrottled || (!shouldThrottleBandwithForWWANOnly && (maxBandwidthPerSecond > 0)); 4496 + BOOL throttle = isBandwidthThrottled || (!shouldThrottleBandwidthForWWANOnly && (maxBandwidthPerSecond > 0));
4496 [bandwidthThrottlingLock unlock]; 4497 [bandwidthThrottlingLock unlock];
4497 return throttle; 4498 return throttle;
4498 #else 4499 #else
@@ -4572,7 +4573,7 @@ static NSOperationQueue *sharedQueue = nil; @@ -4572,7 +4573,7 @@ static NSOperationQueue *sharedQueue = nil;
4572 // Are we performing bandwidth throttling? 4573 // Are we performing bandwidth throttling?
4573 if ( 4574 if (
4574 #if TARGET_OS_IPHONE 4575 #if TARGET_OS_IPHONE
4575 - isBandwidthThrottled || (!shouldThrottleBandwithForWWANOnly && (maxBandwidthPerSecond)) 4576 + isBandwidthThrottled || (!shouldThrottleBandwidthForWWANOnly && (maxBandwidthPerSecond))
4576 #else 4577 #else
4577 maxBandwidthPerSecond 4578 maxBandwidthPerSecond
4578 #endif 4579 #endif
@@ -4624,7 +4625,7 @@ static NSOperationQueue *sharedQueue = nil; @@ -4624,7 +4625,7 @@ static NSOperationQueue *sharedQueue = nil;
4624 [ASIHTTPRequest setMaxBandwidthPerSecond:0]; 4625 [ASIHTTPRequest setMaxBandwidthPerSecond:0];
4625 [bandwidthThrottlingLock lock]; 4626 [bandwidthThrottlingLock lock];
4626 isBandwidthThrottled = NO; 4627 isBandwidthThrottled = NO;
4627 - shouldThrottleBandwithForWWANOnly = NO; 4628 + shouldThrottleBandwidthForWWANOnly = NO;
4628 [bandwidthThrottlingLock unlock]; 4629 [bandwidthThrottlingLock unlock];
4629 } 4630 }
4630 } 4631 }
@@ -4632,7 +4633,7 @@ static NSOperationQueue *sharedQueue = nil; @@ -4632,7 +4633,7 @@ static NSOperationQueue *sharedQueue = nil;
4632 + (void)throttleBandwidthForWWANUsingLimit:(unsigned long)limit 4633 + (void)throttleBandwidthForWWANUsingLimit:(unsigned long)limit
4633 { 4634 {
4634 [bandwidthThrottlingLock lock]; 4635 [bandwidthThrottlingLock lock];
4635 - shouldThrottleBandwithForWWANOnly = YES; 4636 + shouldThrottleBandwidthForWWANOnly = YES;
4636 maxBandwidthPerSecond = limit; 4637 maxBandwidthPerSecond = limit;
4637 [ASIHTTPRequest registerForNetworkReachabilityNotifications]; 4638 [ASIHTTPRequest registerForNetworkReachabilityNotifications];
4638 [bandwidthThrottlingLock unlock]; 4639 [bandwidthThrottlingLock unlock];
@@ -22,6 +22,9 @@ @@ -22,6 +22,9 @@
22 22
23 -(void) dealloc { 23 -(void) dealloc {
24 [name release]; 24 [name release];
  25 + [cdnURL release];
  26 + [referrerACL release];
  27 + [useragentACL release];
25 [super dealloc]; 28 [super dealloc];
26 } 29 }
27 30
@@ -29,4 +29,13 @@ @@ -29,4 +29,13 @@
29 @synthesize creationDate; 29 @synthesize creationDate;
30 @synthesize ownerID; 30 @synthesize ownerID;
31 @synthesize ownerName; 31 @synthesize ownerName;
  32 +
  33 +- (void)dealloc
  34 +{
  35 + [name release];
  36 + [creationDate release];
  37 + [ownerID release];
  38 + [ownerName release];
  39 +}
  40 +
32 @end 41 @end
@@ -115,6 +115,12 @@ @@ -115,6 +115,12 @@
115 } 115 }
116 } 116 }
117 117
  118 +- (void)dealloc
  119 +{
  120 + [popoverController release];
  121 + [rootPopoverButtonItem release];
  122 + [super dealloc];
  123 +}
118 124
119 @synthesize splitViewController; 125 @synthesize splitViewController;
120 @synthesize popoverController; 126 @synthesize popoverController;