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
2008-11-11 17:31:02 +0000
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
b8f5f3627e6ff13e6827ac2c7afb4473e78d29dd
b8f5f362
1 parent
31fe833e
Tweak tests to ensure old waitUntilAllOperationsAreFinished behaviour works again
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
19 deletions
ASIHTTPRequest.h
ASIHTTPRequest.m
ASINetworkQueue.h
ASINetworkQueueTests.m
ASIHTTPRequest.h
View file @
b8f5f36
...
...
@@ -10,8 +10,6 @@
// Portions are based on the ImageClient example from Apple:
// See: http://developer.apple.com/samplecode/ImageClient/listing37.html
#import <Cocoa/Cocoa.h>
@interface
ASIHTTPRequest
:
NSOperation
{
//The url for this operation, should include GET params in the query string where appropriate
...
...
ASIHTTPRequest.m
View file @
b8f5f36
...
...
@@ -629,7 +629,7 @@ static NSRecursiveLock *progressLock;
-
(
void
)
requestFinished
{
if
(
didFinishSelector
&&
!
[
self
isCancelled
]
&&
[
delegate
respondsToSelector
:
didFinishSelector
])
{
[
delegate
performSelectorOnMainThread
:
didFinishSelector
withObject
:
self
waitUntilDone
:
YES
];
[
delegate
performSelectorOnMainThread
:
didFinishSelector
withObject
:
self
waitUntilDone
:
[
NSThread
isMainThread
]
];
}
}
...
...
@@ -648,7 +648,7 @@ static NSRecursiveLock *progressLock;
NSLog
(
problem
);
if
(
didFailSelector
&&
!
[
self
isCancelled
]
&&
[
delegate
respondsToSelector
:
didFailSelector
])
{
[
delegate
performSelectorOnMainThread
:
didFailSelector
withObject
:
self
waitUntilDone
:
YES
];
[
delegate
performSelectorOnMainThread
:
didFailSelector
withObject
:
self
waitUntilDone
:
[
NSThread
isMainThread
]
];
}
}
}
...
...
@@ -823,7 +823,7 @@ static NSRecursiveLock *progressLock;
ignoreError
=
YES
;
[
self
setLastActivityTime
:
nil
];
if
([
delegate
respondsToSelector
:
@selector
(
authorizationNeededForRequest
:)])
{
[
delegate
performSelectorOnMainThread
:
@selector
(
authorizationNeededForRequest
:)
withObject
:
self
waitUntilDone
:
YES
];
[
delegate
performSelectorOnMainThread
:
@selector
(
authorizationNeededForRequest
:)
withObject
:
self
waitUntilDone
:
[
NSThread
isMainThread
]
];
[
authenticationLock
lockWhenCondition
:
2
];
[
authenticationLock
unlock
];
...
...
@@ -865,7 +865,7 @@ static NSRecursiveLock *progressLock;
// We've got no credentials, let's ask the delegate to sort this out
ignoreError
=
YES
;
if
([
delegate
respondsToSelector
:
@selector
(
authorizationNeededForRequest
:)])
{
[
delegate
performSelectorOnMainThread
:
@selector
(
authorizationNeededForRequest
:)
withObject
:
self
waitUntilDone
:
YES
];
[
delegate
performSelectorOnMainThread
:
@selector
(
authorizationNeededForRequest
:)
withObject
:
self
waitUntilDone
:
[
NSThread
isMainThread
]
];
[
authenticationLock
lockWhenCondition
:
2
];
[
authenticationLock
unlock
];
[
self
attemptToApplyCredentialsAndResume
];
...
...
ASINetworkQueue.h
View file @
b8f5f36
...
...
@@ -6,7 +6,6 @@
// Copyright 2008 All-Seeing Interactive. All rights reserved.
//
#import <Cocoa/Cocoa.h>
@interface
ASINetworkQueue
:
NSOperationQueue
{
...
...
ASINetworkQueueTests.m
View file @
b8f5f36
...
...
@@ -66,10 +66,7 @@
[
networkQueue
go
];
endDate
=
[
NSDate
distantFuture
];
while
(
!
complete
)
{
[[
NSRunLoop
currentRunLoop
]
runMode
:
NSDefaultRunLoopMode
beforeDate
:
endDate
];
}
[
networkQueue
waitUntilAllOperationsAreFinished
];
success
=
(
progress
==
1
.
0
);
STAssertTrue
(
success
,
@"Failed to increment progress properly"
);
...
...
@@ -121,10 +118,7 @@
[
networkQueue
go
];
NSDate
*
endDate
=
[
NSDate
distantFuture
];
while
(
!
complete
)
{
[[
NSRunLoop
currentRunLoop
]
runMode
:
NSDefaultRunLoopMode
beforeDate
:
endDate
];
}
[
networkQueue
waitUntilAllOperationsAreFinished
];
BOOL
success
;
...
...
@@ -190,10 +184,7 @@
[
networkQueue
go
];
NSDate
*
endDate
=
[
NSDate
distantFuture
];
while
(
!
complete
)
{
[[
NSRunLoop
currentRunLoop
]
runMode
:
NSDefaultRunLoopMode
beforeDate
:
endDate
];
}
[
networkQueue
waitUntilAllOperationsAreFinished
];
[
requestThatShouldFail
release
];
...
...
Please
register
or
login
to post a comment