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-07-27 13:10:55 +0100
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
1da8a862b3b198c357256b146dd734353a4f984c
1da8a862
1 parent
53221f80
Move delegate authentication retries onto request thread
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
Classes/ASIHTTPRequest.m
Classes/Tests/ASIHTTPRequestTests.m
Classes/ASIHTTPRequest.m
View file @
1da8a86
...
...
@@ -23,7 +23,7 @@
// Automatically set on build
NSString
*
ASIHTTPRequestVersion
=
@"v1.7-
25 2010-07-22
"
;
NSString
*
ASIHTTPRequestVersion
=
@"v1.7-
34 2010-07-27
"
;
NSString
*
const
NetworkRequestErrorDomain
=
@"ASIHTTPRequestErrorDomain"
;
...
...
@@ -176,6 +176,8 @@ static NSOperationQueue *sharedQueue = nil;
// Called when the status of the network changes
+
(
void
)
reachabilityChanged
:(
NSNotification
*
)
note
;
-
(
void
)
failAuthentication
;
#endif
@property
(
assign
)
BOOL
complete
;
...
...
@@ -2164,12 +2166,17 @@ static NSOperationQueue *sharedQueue = nil;
// Called by delegate or authentication dialog to resume loading once authentication info has been populated
-
(
void
)
retryUsingSuppliedCredentials
{
[
self
attemptToApplyCredentialsAndResume
];
[
self
performSelector
:
@selector
(
attemptToApplyCredentialsAndResume
)
onThread
:[[
self
class
]
threadForRequest
:
self
]
withObject
:
nil
waitUntilDone
:
NO
];
}
// Called by delegate or authentication dialog to cancel authentication
-
(
void
)
cancelAuthentication
{
[
self
performSelector
:
@selector
(
failAuthentication
)
onThread
:[[
self
class
]
threadForRequest
:
self
]
withObject
:
nil
waitUntilDone
:
NO
];
}
-
(
void
)
failAuthentication
{
[
self
failWithError
:
ASIAuthenticationError
];
}
...
...
Classes/Tests/ASIHTTPRequestTests.m
View file @
1da8a86
...
...
@@ -76,6 +76,7 @@
ASIHTTPRequest
*
request
=
[
ASIHTTPRequest
requestWithURL
:[
NSURL
URLWithString
:
@"http://allseeing-i.com/ASIHTTPRequest/tests/the_great_american_novel_%28abridged%29.txt"
]];
[
request
startAsynchronous
];
[
request
cancel
];
[[
NSRunLoop
currentRunLoop
]
runUntilDate
:[
NSDate
dateWithTimeIntervalSinceNow
:
2
.
0
]];
GHAssertNotNil
([
request
error
],
@"Failed to cancel the request"
);
// Test cancelling a redirected request works
...
...
@@ -85,6 +86,7 @@
[[
NSRunLoop
currentRunLoop
]
runUntilDate
:[
NSDate
dateWithTimeIntervalSinceNow
:
2
.
0
]];
[
request
cancel
];
[[
NSRunLoop
currentRunLoop
]
runUntilDate
:[
NSDate
dateWithTimeIntervalSinceNow
:
2
.
0
]];
BOOL
success
=
([[[
request
url
]
absoluteString
]
isEqualToString
:
@"http://allseeing-i.com/ASIHTTPRequest/tests/the_great_american_novel.txt"
]);
...
...
Please
register
or
login
to post a comment