From b5f8117ecf8503ade9246d30aef0095b256c4bbb Mon Sep 17 00:00:00 2001 From: mccallum Date: Mon, 6 Jan 1997 22:22:11 +0000 Subject: [PATCH] * src/Connection.m ([Connection +rootProxyAtName:onHost:]): Return nil if we fail to create a port for talking to a remote server. ([Connection forwardForProxy:selector:argFrame:]): Changes to ensure that ConnectedDecoder is correctly dismissed in the case where a DO method returns an object but does not have any parameter values returned. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@2016 72102866-910b-0410-8b05-ffd578937521 --- Source/Connection.m | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Source/Connection.m b/Source/Connection.m index b1bd2e921..7c14c53b5 100644 --- a/Source/Connection.m +++ b/Source/Connection.m @@ -322,6 +322,7 @@ static int messages_received_count; + (Proxy*) rootProxyAtName: (NSString*)n onHost: (NSString*)h { id p = [default_out_port_class newForSendingToRegisteredName: n onHost: h]; + if (p == nil) return p; return [self rootProxyAtPort: p]; } @@ -583,12 +584,18 @@ static int messages_received_count; /* Get the reply rmc, and decode it. */ { ConnectedDecoder *ip = nil; - int last_argnum; BOOL is_exception; void decoder(int argnum, void *datum, const char *type, int flags) { - NSParameterAssert(ip != (id)-1); + if (type == 0) { + if (ip) { + /* this must be here to avoid trashing alloca'ed retframe */ + [ip dismiss]; + ip = nil; + } + return; + } /* If we didn't get the reply packet yet, get it now. */ if (!ip) { @@ -619,15 +626,8 @@ static int messages_received_count; autorelease'ed. */ if (*type == _C_CHARPTR) [MallocAddress autoreleaseMallocAddress: *(char**)datum]; - if (argnum == last_argnum) - { - /* this must be here to avoid trashing alloca'ed retframe */ - [ip dismiss]; - ip = (id)-1; - } } - last_argnum = type_get_number_of_arguments(type) - 1; retframe = mframe_build_return (argframe, type, out_parameters, decoder); /* Make sure we processed all arguments, and dismissed the IP. */