mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Improve timeout handling when doing synchronous load
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@36759 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
4494ace2d5
commit
47f6a3db6a
1 changed files with 23 additions and 5 deletions
|
@ -26,6 +26,7 @@
|
|||
|
||||
#define EXPOSE_NSURLConnection_IVARS 1
|
||||
#import "Foundation/NSError.h"
|
||||
#import "Foundation/NSURLError.h"
|
||||
#import "Foundation/NSRunLoop.h"
|
||||
#import "GSURLPrivate.h"
|
||||
|
||||
|
@ -333,14 +334,31 @@ typedef struct
|
|||
{
|
||||
[loop runMode: NSDefaultRunLoopMode beforeDate: limit];
|
||||
}
|
||||
data = [[[collector data] retain] autorelease];
|
||||
if (0 != response)
|
||||
if (NO == [collector done])
|
||||
{
|
||||
*response = [[[collector response] retain] autorelease];
|
||||
data = nil;
|
||||
if (0 != response)
|
||||
{
|
||||
*response = nil;
|
||||
}
|
||||
if (0 != error)
|
||||
{
|
||||
*error = [NSError errorWithDomain: NSURLErrorDomain
|
||||
code: NSURLErrorTimedOut
|
||||
userInfo: nil];
|
||||
}
|
||||
}
|
||||
if (0 != error)
|
||||
else
|
||||
{
|
||||
*error = [[[collector error] retain] autorelease];
|
||||
data = [[[collector data] retain] autorelease];
|
||||
if (0 != response)
|
||||
{
|
||||
*response = [[[collector response] retain] autorelease];
|
||||
}
|
||||
if (0 != error)
|
||||
{
|
||||
*error = [[[collector error] retain] autorelease];
|
||||
}
|
||||
}
|
||||
[conn release];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue