handle invalidation of connection while getting root proxy

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@37768 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2014-03-26 07:56:09 +00:00
parent f5326c8db1
commit 974fa5d811
3 changed files with 29 additions and 16 deletions

View file

@ -1,3 +1,8 @@
2014-03-26 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSConnection.m: handle invalidation of connection while
getting root proxy.
2014-03-26 Riccardo Mottola <rm@gnu.org>
* Source/NSProcessInfo.m (determineOperatingSystem):

View file

@ -1673,20 +1673,32 @@ static NSLock *cached_proxies_gate = nil;
NSParameterAssert(IreceivePort);
NSParameterAssert(IisValid);
/*
* If this is a server connection without a remote end, its root proxy
* is the same as its root object.
*/
if (IreceivePort == IsendPort)
NS_DURING
{
return [self rootObject];
}
op = [self _makeOutRmc: 0 generate: &seq_num reply: YES];
[self _sendOutRmc: op type: ROOTPROXY_REQUEST];
/*
* If this is a server connection without a remote end, its root proxy
* is the same as its root object.
*/
if (IreceivePort == IsendPort)
{
return [self rootObject];
}
op = [self _makeOutRmc: 0 generate: &seq_num reply: YES];
[self _sendOutRmc: op type: ROOTPROXY_REQUEST];
ip = [self _getReplyRmc: seq_num];
[ip decodeValueOfObjCType: @encode(id) at: &newProxy];
[self _doneInRmc: ip];
}
NS_HANDLER
{
/* The ports/connection may have been invalidated while getting the
* root proxy ... if so we should return nil.
*/
newProxy = nil;
}
NS_ENDHANDLER
ip = [self _getReplyRmc: seq_num];
[ip decodeValueOfObjCType: @encode(id) at: &newProxy];
[self _doneInRmc: ip];
return AUTORELEASE(newProxy);
}

View file

@ -124,10 +124,6 @@
#import "GSPrivate.h"
@interface NSBundle (Private)
+ (NSString*) _gnustep_target_os;
@end
/* This error message should be called only if the private main function
* was not executed successfully. This may happen ONLY if another library
* or kit defines its own main function (as gnustep-base does).