Minor parsing fixes for autogsdoc and fix for NSHosting

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@12078 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
CaS 2002-01-10 16:33:11 +00:00
parent 7238052daa
commit ae95e06a9f
4 changed files with 111 additions and 12 deletions

View file

@ -37,6 +37,8 @@
#include <Foundation/NSRunLoop.h>
#include <Foundation/NSTask.h>
#include <Foundation/NSDistributedNotificationCenter.h>
#include <Foundation/NSUserDefaults.h>
#include <Foundation/NSHost.h>
#include "../Tools/gdnc.h"
@ -317,11 +319,34 @@ static NSDistributedNotificationCenter *defCenter = nil;
{
if (_remote == nil)
{
NSString *host;
/*
* Connect to the NSDistributedNotificationCenter for this host.
*/
host = [[NSUserDefaults standardUserDefaults] stringForKey: @"NSHost"];
if (host == nil)
{
host = @"";
}
else
{
NSHost *h;
/*
* If we have a host specified, but it is the current host,
* we do not need to ask for a host by name (nameserver lookup
* can be faster) and the empty host name can be used to
* indicate that we may start a gdnc server locally.
*/
h = [NSHost hostWithName: host];
if ([h isEqual: [NSHost currentHost]] == YES)
{
host = @"";
}
}
_remote = RETAIN([NSConnection rootProxyForConnectionWithRegisteredName:
GDNC_SERVICE host: @""]);
GDNC_SERVICE host: host]);
if (_remote != nil)
{
@ -340,7 +365,7 @@ static NSDistributedNotificationCenter *defCenter = nil;
object: c];
[_remote registerClient: (id<GDNCClient>)self];
}
else
else if ([host isEqual: @""] == YES)
{
static BOOL recursion = NO;
@ -373,6 +398,11 @@ NSLog(@"Connection to GDNC server established.\n");
MAKE_GDNC_ERR];
}
}
else
{
[NSException raise: NSInternalInconsistencyException
format: @"unable to contact GDNC server on %@", host];
}
}
}