Ensure sync requests on main thread call blocks synchronously
Fix blocks test
Showing
2 changed files
with
4 additions
and
4 deletions
| @@ -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.7-125 2010-10-31"; | 27 | +NSString *ASIHTTPRequestVersion = @"v1.7-126 2010-10-31"; |
| 28 | 28 | ||
| 29 | NSString* const NetworkRequestErrorDomain = @"ASIHTTPRequestErrorDomain"; | 29 | NSString* const NetworkRequestErrorDomain = @"ASIHTTPRequestErrorDomain"; |
| 30 | 30 | ||
| @@ -1672,7 +1672,7 @@ static NSOperationQueue *sharedQueue = nil; | @@ -1672,7 +1672,7 @@ static NSOperationQueue *sharedQueue = nil; | ||
| 1672 | #if NS_BLOCKS_AVAILABLE | 1672 | #if NS_BLOCKS_AVAILABLE |
| 1673 | - (void)performBlockOnMainThread:(ASIBasicBlock)block | 1673 | - (void)performBlockOnMainThread:(ASIBasicBlock)block |
| 1674 | { | 1674 | { |
| 1675 | - [self performSelectorOnMainThread:@selector(callBlock:) withObject:[[block copy] autorelease] waitUntilDone:NO]; | 1675 | + [self performSelectorOnMainThread:@selector(callBlock:) withObject:[[block copy] autorelease] waitUntilDone:[NSThread isMainThread]]; |
| 1676 | } | 1676 | } |
| 1677 | 1677 | ||
| 1678 | - (void)callBlock:(ASIBasicBlock)block | 1678 | - (void)callBlock:(ASIBasicBlock)block |
| @@ -69,9 +69,9 @@ | @@ -69,9 +69,9 @@ | ||
| 69 | GHAssertTrue(receivedHeaders,@"Failed to call received headers block"); | 69 | GHAssertTrue(receivedHeaders,@"Failed to call received headers block"); |
| 70 | GHAssertTrue(complete,@"Failed to call completed block"); | 70 | GHAssertTrue(complete,@"Failed to call completed block"); |
| 71 | 71 | ||
| 72 | - BOOL success = (totalBytesReceived == 130050); | 72 | + BOOL success = (totalBytesReceived == 457); |
| 73 | GHAssertTrue(success,@"Failed to call bytes received block, or got wrong amount of data"); | 73 | GHAssertTrue(success,@"Failed to call bytes received block, or got wrong amount of data"); |
| 74 | - success = (totalDownloadSize == 130050); | 74 | + success = (totalDownloadSize == 457); |
| 75 | GHAssertTrue(success,@"Failed to call download size increment block"); | 75 | GHAssertTrue(success,@"Failed to call download size increment block"); |
| 76 | 76 | ||
| 77 | success = (totalBytesSent == [dataToSend length]); | 77 | success = (totalBytesSent == [dataToSend length]); |
-
Please register or login to post a comment