Ben Copsey

Use addTimeInterval: on iPhone OS

@@ -21,7 +21,7 @@ @@ -21,7 +21,7 @@
21 #import "ASIInputStream.h" 21 #import "ASIInputStream.h"
22 22
23 // Automatically set on build 23 // Automatically set on build
24 -NSString *ASIHTTPRequestVersion = @"v1.2-35 2009-12-17"; 24 +NSString *ASIHTTPRequestVersion = @"v1.2-36 2009-12-17";
25 25
26 NSString* const NetworkRequestErrorDomain = @"ASIHTTPRequestErrorDomain"; 26 NSString* const NetworkRequestErrorDomain = @"ASIHTTPRequestErrorDomain";
27 27
@@ -3091,7 +3091,11 @@ static BOOL isiPhoneOS2; @@ -3091,7 +3091,11 @@ static BOOL isiPhoneOS2;
3091 // Yes, put this request to sleep until a second is up, with extra added punishment sleeping time for being very naughty (we have used more bandwidth than we were allowed) 3091 // Yes, put this request to sleep until a second is up, with extra added punishment sleeping time for being very naughty (we have used more bandwidth than we were allowed)
3092 double extraSleepyTime = (-bytesRemaining/(maxBandwidthPerSecond*1.0)); 3092 double extraSleepyTime = (-bytesRemaining/(maxBandwidthPerSecond*1.0));
3093 [throttleWakeUpTime release]; 3093 [throttleWakeUpTime release];
  3094 + #if TARGET_OS_IPHONE
  3095 + throttleWakeUpTime = [[bandwidthMeasurementDate addTimeInterval:extraSleepyTime] retain];
  3096 + #else
3094 throttleWakeUpTime = [[bandwidthMeasurementDate dateByAddingTimeInterval:extraSleepyTime] retain]; 3097 throttleWakeUpTime = [[bandwidthMeasurementDate dateByAddingTimeInterval:extraSleepyTime] retain];
  3098 + #endif
3095 } 3099 }
3096 } 3100 }
3097 [bandwidthThrottlingLock unlock]; 3101 [bandwidthThrottlingLock unlock];