Fix forwarding of methods not in the proxies protocl if a protocol is set.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@19826 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Alexander Malmberg 2004-08-05 00:03:30 +00:00
parent 95ce8fe2b2
commit b31c59f874
2 changed files with 26 additions and 13 deletions

View file

@ -1,3 +1,11 @@
2004-08-05 01:59 Alexander Malmberg <alexander@malmberg.org>
* Source/NSDistantObject.m (DO_FORWARD_INVOCATION): Warning if we
can't do the forwarding.
(-methodSignatureForSelector:): If a protocol has been set but
doesn't contain info about the selector, forward the request to
the other end of the connection.
2004-08-04 David Ayers <d.ayers@inode.at>
* Testing/nsmethodsignature.m: New test.

View file

@ -28,6 +28,7 @@
#include "config.h"
#include "GNUstepBase/preface.h"
#include "GNUstepBase/DistributedObjects.h"
#include "Foundation/NSDebug.h"
#include "Foundation/NSLock.h"
#include "Foundation/NSPort.h"
#include "Foundation/NSMethodSignature.h"
@ -37,13 +38,20 @@
#define DO_FORWARD_INVOCATION(_SELX, _ARG1) ({ \
sig = [self methodSignatureForSelector: @selector(_SELX)]; \
if (sig != nil) { \
inv = [NSInvocation invocationWithMethodSignature: sig]; \
[inv setSelector: @selector(_SELX)]; \
[inv setTarget: self]; \
[inv setArgument: (void*)&_ARG1 atIndex: 2]; \
[self forwardInvocation: inv]; \
[inv getReturnValue: &m]; }})
if (sig != nil) \
{ \
inv = [NSInvocation invocationWithMethodSignature: sig]; \
[inv setSelector: @selector(_SELX)]; \
[inv setTarget: self]; \
[inv setArgument: (void*)&_ARG1 atIndex: 2]; \
[self forwardInvocation: inv]; \
[inv getReturnValue: &m]; \
} \
else \
{ \
NSWarnLog(@"DO_FORWARD_INVOCATION failed, got nil signature for '%@'.", \
NSStringFromSelector(@selector(_SELX))); \
}})
static int debug_proxy = 0;
@ -716,13 +724,10 @@ enum
{
types = mth->types;
}
if (types == 0)
{
return nil;
}
return [NSMethodSignature signatureWithObjCTypes: types];
if (types)
return [NSMethodSignature signatureWithObjCTypes: types];
}
else
{
id m = nil;
#if defined(USE_FFCALL) || defined(USE_LIBFFI)