mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-29 16:01:38 +00:00
Fixup to perform a full load
This commit is contained in:
parent
4b5e342c89
commit
e6c387f8fd
1 changed files with 14 additions and 8 deletions
|
@ -67,7 +67,7 @@ resourceDataDidBecomeAvailable: (NSData *)newBytes
|
|||
{
|
||||
[_receivedData release];
|
||||
}
|
||||
_receivedData = newBytes;
|
||||
_receivedData = [newBytes retain];
|
||||
}
|
||||
|
||||
- (void) URLHandle: (NSURLHandle *)sender
|
||||
|
@ -108,7 +108,7 @@ resourceDidFailLoadingWithReason: (NSString *)reason
|
|||
[handle beginLoadInBackground];
|
||||
[handle cancelLoadInBackground];
|
||||
PASS([self status] == URLHandleClientDidCancelLoading,
|
||||
"URLHandleResourceDidCancelLoading called");
|
||||
"URLHandleClientDidCancelLoading called");
|
||||
[handle release];
|
||||
|
||||
handle = [[cls alloc] initWithURL: url cached: NO];
|
||||
|
@ -118,16 +118,22 @@ resourceDidFailLoadingWithReason: (NSString *)reason
|
|||
*/
|
||||
[handle writeProperty: @"POST" forKey: GSHTTPPropertyMethodKey];
|
||||
[handle writeData: [@"Hello" dataUsingEncoding: NSASCIIStringEncoding]];
|
||||
|
||||
[handle setReturnAll: YES];
|
||||
[handle loadInBackground];
|
||||
PASS([self status] == URLHandleClientDidBeginLoading,
|
||||
"URLHandleResourceDidBeginLoading called");
|
||||
"URLHandleClientDidBeginLoading called");
|
||||
|
||||
[[NSRunLoop currentRunLoop] runMode: NSDefaultRunLoopMode
|
||||
beforeDate: [NSDate dateWithTimeIntervalSinceNow: 1.0]];
|
||||
PASS([self status] == URLHandleClientDidBeginLoading,
|
||||
"URLHandleResourceDidFinishLoading called");
|
||||
NSDate *limit = [NSDate dateWithTimeIntervalSinceNow: 5.0];
|
||||
while ([limit timeIntervalSinceNow] > 0.0
|
||||
&& [self status] != URLHandleClientDidFinishLoading)
|
||||
{
|
||||
[[NSRunLoop currentRunLoop] runMode: NSDefaultRunLoopMode
|
||||
beforeDate: limit];
|
||||
}
|
||||
PASS([self status] == URLHandleClientDidFinishLoading,
|
||||
"URLHandleClientDidFinishLoading called");
|
||||
|
||||
NSLog(@"Data %@", [handle availableResourceData]);
|
||||
[handle release];
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue