mirror of
https://github.com/gnustep/libs-base.git
synced 2025-06-01 01:01:03 +00:00
Minor fixes to use of local hostname.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@20112 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
d853b47094
commit
7fc70e35ff
2 changed files with 12 additions and 5 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2004-09-22 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
|
* Source/NSHost.m: Use isEqualToString rather than == to test for
|
||||||
|
the special local host name. Fix check for nil hostname in
|
||||||
|
([_initWithHostEntry:key:])
|
||||||
|
|
||||||
2004-09-21 Richard Frith-Macdonald <rfm@gnu.org>
|
2004-09-21 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
* Source/NSConnection.m: ([_getReplyRmc:]) improve timeout code.
|
* Source/NSConnection.m: ([_getReplyRmc:]) improve timeout code.
|
||||||
|
|
|
@ -146,14 +146,15 @@ static NSMutableDictionary *_hostCache = nil;
|
||||||
{
|
{
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
if (name != localHostName && entry == (struct hostent*)NULL)
|
if ([name isEqualToString: localHostName] == NO
|
||||||
|
&& entry == (struct hostent*)NULL)
|
||||||
{
|
{
|
||||||
NSLog(@"Host '%@' init failed - perhaps the name/address is wrong or "
|
NSLog(@"Host '%@' init failed - perhaps the name/address is wrong or "
|
||||||
@"networking is not set up on your machine", name);
|
@"networking is not set up on your machine", name);
|
||||||
RELEASE(self);
|
RELEASE(self);
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
else if (localHostName == nil && entry != (struct hostent*)NULL)
|
else if (name == nil && entry != (struct hostent*)NULL)
|
||||||
{
|
{
|
||||||
NSLog(@"Nil hostname supplied but network database entry is not empty");
|
NSLog(@"Nil hostname supplied but network database entry is not empty");
|
||||||
RELEASE(self);
|
RELEASE(self);
|
||||||
|
@ -163,7 +164,7 @@ static NSMutableDictionary *_hostCache = nil;
|
||||||
names = [NSMutableSet new];
|
names = [NSMutableSet new];
|
||||||
addresses = [NSMutableSet new];
|
addresses = [NSMutableSet new];
|
||||||
|
|
||||||
if (name == localHostName)
|
if ([name isEqualToString: localHostName] == YES)
|
||||||
{
|
{
|
||||||
extra = [hostClass _localAddresses];
|
extra = [hostClass _localAddresses];
|
||||||
}
|
}
|
||||||
|
@ -325,13 +326,13 @@ myHostName()
|
||||||
}
|
}
|
||||||
if (host == nil)
|
if (host == nil)
|
||||||
{
|
{
|
||||||
if (name == localHostName)
|
if ([name isEqualToString: localHostName] == YES)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Special GNUstep extension host - we try to have a host entry
|
* Special GNUstep extension host - we try to have a host entry
|
||||||
* with ALL the IP addresses of any interfaces on the local machine
|
* with ALL the IP addresses of any interfaces on the local machine
|
||||||
*/
|
*/
|
||||||
host = [[self alloc] _initWithHostEntry: 0 key: name];
|
host = [[self alloc] _initWithHostEntry: 0 key: localHostName];
|
||||||
AUTORELEASE(host);
|
AUTORELEASE(host);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue