Showing
1 changed file
with
11 additions
and
7 deletions
| @@ -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-32 2009-12-17"; | 24 | +NSString *ASIHTTPRequestVersion = @"v1.2-33 2009-12-17"; |
| 25 | 25 | ||
| 26 | NSString* const NetworkRequestErrorDomain = @"ASIHTTPRequestErrorDomain"; | 26 | NSString* const NetworkRequestErrorDomain = @"ASIHTTPRequestErrorDomain"; |
| 27 | 27 | ||
| @@ -394,6 +394,9 @@ static BOOL isiPhoneOS2; | @@ -394,6 +394,9 @@ static BOOL isiPhoneOS2; | ||
| 394 | 394 | ||
| 395 | - (void)cancel | 395 | - (void)cancel |
| 396 | { | 396 | { |
| 397 | + #if DEBUG_REQUEST_STATUS | ||
| 398 | + NSLog(@"Request cancelled: %@",self); | ||
| 399 | + #endif | ||
| 397 | [[self cancelledLock] lock]; | 400 | [[self cancelledLock] lock]; |
| 398 | 401 | ||
| 399 | if ([self isCancelled] || [self complete]) { | 402 | if ([self isCancelled] || [self complete]) { |
| @@ -913,8 +916,6 @@ static BOOL isiPhoneOS2; | @@ -913,8 +916,6 @@ static BOOL isiPhoneOS2; | ||
| 913 | 916 | ||
| 914 | [self performThrottling]; | 917 | [self performThrottling]; |
| 915 | 918 | ||
| 916 | - | ||
| 917 | - | ||
| 918 | // See if we need to timeout | 919 | // See if we need to timeout |
| 919 | if (lastActivityTime && timeOutSeconds > 0 && [now timeIntervalSinceDate:lastActivityTime] > timeOutSeconds) { | 920 | if (lastActivityTime && timeOutSeconds > 0 && [now timeIntervalSinceDate:lastActivityTime] > timeOutSeconds) { |
| 920 | 921 | ||
| @@ -1069,7 +1070,6 @@ static BOOL isiPhoneOS2; | @@ -1069,7 +1070,6 @@ static BOOL isiPhoneOS2; | ||
| 1069 | [self updateDownloadProgress]; | 1070 | [self updateDownloadProgress]; |
| 1070 | } | 1071 | } |
| 1071 | } | 1072 | } |
| 1072 | - | ||
| 1073 | } | 1073 | } |
| 1074 | 1074 | ||
| 1075 | 1075 | ||
| @@ -1152,9 +1152,6 @@ static BOOL isiPhoneOS2; | @@ -1152,9 +1152,6 @@ static BOOL isiPhoneOS2; | ||
| 1152 | } | 1152 | } |
| 1153 | } | 1153 | } |
| 1154 | 1154 | ||
| 1155 | - | ||
| 1156 | - | ||
| 1157 | - | ||
| 1158 | if (totalBytesSent == 0) { | 1155 | if (totalBytesSent == 0) { |
| 1159 | return; | 1156 | return; |
| 1160 | } | 1157 | } |
| @@ -1372,6 +1369,9 @@ static BOOL isiPhoneOS2; | @@ -1372,6 +1369,9 @@ static BOOL isiPhoneOS2; | ||
| 1372 | // If you do this, don't forget to call [super failWithError:] to let the queue / delegate know we're done | 1369 | // If you do this, don't forget to call [super failWithError:] to let the queue / delegate know we're done |
| 1373 | - (void)failWithError:(NSError *)theError | 1370 | - (void)failWithError:(NSError *)theError |
| 1374 | { | 1371 | { |
| 1372 | +#if DEBUG_REQUEST_STATUS || DEBUG_THROTTLING | ||
| 1373 | + NSLog(@"Request failed: %@",self); | ||
| 1374 | +#endif | ||
| 1375 | [self setComplete:YES]; | 1375 | [self setComplete:YES]; |
| 1376 | 1376 | ||
| 1377 | if ([self isCancelled] || [self error]) { | 1377 | if ([self isCancelled] || [self error]) { |
| @@ -1531,6 +1531,10 @@ static BOOL isiPhoneOS2; | @@ -1531,6 +1531,10 @@ static BOOL isiPhoneOS2; | ||
| 1531 | // This means manually added cookies will not be added to the redirect request - only those stored in the global persistent store | 1531 | // This means manually added cookies will not be added to the redirect request - only those stored in the global persistent store |
| 1532 | // But, this is probably the safest option - we might be redirecting to a different domain | 1532 | // But, this is probably the safest option - we might be redirecting to a different domain |
| 1533 | [self setRequestCookies:[NSMutableArray array]]; | 1533 | [self setRequestCookies:[NSMutableArray array]]; |
| 1534 | + | ||
| 1535 | + #if DEBUG_REQUEST_STATUS | ||
| 1536 | + NSLog(@"Request will redirect (code: %hi): %@",self,[self responseStatusCode]); | ||
| 1537 | + #endif | ||
| 1534 | } | 1538 | } |
| 1535 | } | 1539 | } |
| 1536 | 1540 |
-
Please register or login to post a comment