mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Tidied
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@13888 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
0ba2798bb5
commit
dc02e89b70
1 changed files with 22 additions and 20 deletions
|
@ -265,30 +265,32 @@ getAddr(NSString* name, NSString* svc, NSString* pcl, struct sockaddr_in *sin)
|
|||
service: (NSString*)s
|
||||
protocol: (NSString*)p
|
||||
{
|
||||
NSRunLoop *loop;
|
||||
NSDate *limit;
|
||||
|
||||
self = [self initAsClientInBackgroundAtAddress: a
|
||||
service: s
|
||||
protocol: p
|
||||
forModes: nil];
|
||||
if (self != nil)
|
||||
{
|
||||
NSRunLoop *loop;
|
||||
NSDate *limit;
|
||||
|
||||
loop = [NSRunLoop currentRunLoop];
|
||||
limit = [NSDate dateWithTimeIntervalSinceNow: 300];
|
||||
while ([limit timeIntervalSinceNow] > 0
|
||||
&& (readInfo != nil || [writeInfo count] > 0))
|
||||
{
|
||||
[loop runMode: NSDefaultRunLoopMode
|
||||
beforeDate: limit];
|
||||
}
|
||||
if (readInfo != nil || [writeInfo count] > 0 || readOK == NO)
|
||||
{
|
||||
/* Must have timed out or failed */
|
||||
DESTROY(self);
|
||||
}
|
||||
else
|
||||
{
|
||||
[self setNonBlocking: NO];
|
||||
loop = [NSRunLoop currentRunLoop];
|
||||
limit = [NSDate dateWithTimeIntervalSinceNow: 300];
|
||||
while ([limit timeIntervalSinceNow] > 0
|
||||
&& (readInfo != nil || [writeInfo count] > 0))
|
||||
{
|
||||
[loop runMode: NSDefaultRunLoopMode
|
||||
beforeDate: limit];
|
||||
}
|
||||
if (readInfo != nil || [writeInfo count] > 0 || readOK == NO)
|
||||
{
|
||||
/* Must have timed out or failed */
|
||||
DESTROY(self);
|
||||
}
|
||||
else
|
||||
{
|
||||
[self setNonBlocking: NO];
|
||||
}
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
@ -698,8 +700,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
|||
|
||||
if (getAddr(a, s, p, &sin) == NO)
|
||||
{
|
||||
NSLog(@"bad address-service-protocol combination");
|
||||
RELEASE(self);
|
||||
NSLog(@"bad address-service-protocol combination");
|
||||
return nil;
|
||||
}
|
||||
[self setAddr: &sin]; // Store the address of the remote end.
|
||||
|
|
Loading…
Reference in a new issue