Toggle navigation
Toggle navigation
This project
Loading...
Sign in
iOS
/
asi-http-request
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Ben Copsey
2010-10-31 12:29:35 +0000
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
fbae2badfaf970fa6a8ff32d0641be240f965d9d
fbae2bad
1 parent
b61e3fa8
Ensure sync requests on main thread call blocks synchronously
Fix blocks test
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
Classes/ASIHTTPRequest.m
Classes/Tests/BlocksTests.m
Classes/ASIHTTPRequest.m
View file @
fbae2ba
...
...
@@ -24,7 +24,7 @@
#import "ASIDataCompressor.h"
// Automatically set on build
NSString
*
ASIHTTPRequestVersion
=
@"v1.7-12
5
2010-10-31"
;
NSString
*
ASIHTTPRequestVersion
=
@"v1.7-12
6
2010-10-31"
;
NSString
*
const
NetworkRequestErrorDomain
=
@"ASIHTTPRequestErrorDomain"
;
...
...
@@ -1672,7 +1672,7 @@ static NSOperationQueue *sharedQueue = nil;
#if NS_BLOCKS_AVAILABLE
-
(
void
)
performBlockOnMainThread
:
(
ASIBasicBlock
)
block
{
[
self
performSelectorOnMainThread
:
@selector
(
callBlock
:)
withObject
:
[[
block
copy
]
autorelease
]
waitUntilDone
:
NO
];
[
self
performSelectorOnMainThread
:
@selector
(
callBlock
:)
withObject
:
[[
block
copy
]
autorelease
]
waitUntilDone
:
[
NSThread
isMainThread
]
];
}
-
(
void
)
callBlock
:
(
ASIBasicBlock
)
block
...
...
Classes/Tests/BlocksTests.m
View file @
fbae2ba
...
...
@@ -69,9 +69,9 @@
GHAssertTrue
(
receivedHeaders
,
@"Failed to call received headers block"
);
GHAssertTrue
(
complete
,
@"Failed to call completed block"
);
BOOL
success
=
(
totalBytesReceived
==
130050
);
BOOL
success
=
(
totalBytesReceived
==
457
);
GHAssertTrue
(
success
,
@"Failed to call bytes received block, or got wrong amount of data"
);
success
=
(
totalDownloadSize
==
130050
);
success
=
(
totalDownloadSize
==
457
);
GHAssertTrue
(
success
,
@"Failed to call download size increment block"
);
success
=
(
totalBytesSent
==
[
dataToSend
length
]);
...
...
Please
register
or
login
to post a comment