avoid warning log about unexpected response

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29075 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2009-11-27 13:05:26 +00:00
parent 9a772dd309
commit 845201b6f5
4 changed files with 31 additions and 18 deletions

View file

@ -6,6 +6,8 @@
Also, change the meanining of a nil modes argument when enqueing a
notification to match OSX and assume NSDefaultRunLoopMode.
* Source/Additions/GSXML.m: Fix minor sax callback bug.
* Source/NSConnection.m: Don't send a response packet if the method
is oneway void return type and has no output parameters.
2009-11-27 Richard Frith-Macdonald <rfm@gnu.org>

View file

@ -103,6 +103,7 @@ main(int argc, char *argv[], char **env)
#endif
pool = [[NSAutoreleasePool alloc] init];
[NSConnection setDebug: YES];
[Tester startup];
[[NSRunLoop currentRunLoop] run];
[pool release];

View file

@ -2715,16 +2715,9 @@ static NSLock *cached_proxies_gate = nil;
tmp = inv;
inv = nil;
[tmp release];
return;
NS_VOIDRETURN;
}
/* We create a new coder object and set it in the context for
* later use if/when we are called again. We encode a flag to
* say that this is not an exception.
*/
encoder = [self _makeOutRmc: seq generate: 0 reply: NO];
[encoder encodeValueOfObjCType: @encode(BOOL) at: &is_exception];
/* Encode the return value and pass-by-reference values, if there
are any. This logic must match exactly that in
cifframe_build_return(). */
@ -2737,6 +2730,23 @@ static NSLock *cached_proxies_gate = nil;
etmptype = objc_skip_type_qualifiers (encoded_types);
tmptype = objc_skip_type_qualifiers (type);
/* If this is a oneway void with no out parameters, we don't need to
* send back any response.
*/
if (*tmptype == _C_VOID && (flags & _F_ONEWAY) && !out_parameters)
{
tmp = inv;
inv = nil;
[tmp release];
NS_VOIDRETURN;
}
/* We create a new coder object and encode a flag to
* say that this is not an exception.
*/
encoder = [self _makeOutRmc: seq generate: 0 reply: NO];
[encoder encodeValueOfObjCType: @encode(BOOL) at: &is_exception];
/* Only encode return values if there is a non-void return value,
a non-oneway void return value, or if there are values that were
passed by reference. */

View file

@ -296,11 +296,11 @@ ihandler(int sig)
- (id) connectionBecameInvalid: (NSNotification*)notification;
- (void) postNotificationName: (NSString*)notificationName
object: (NSString*)notificationObject
userInfo: (NSData*)d
deliverImmediately: (BOOL)deliverImmediately
for: (id<GDNCClient>)client;
- (oneway void) postNotificationName: (NSString*)notificationName
object: (NSString*)notificationObject
userInfo: (NSData*)d
deliverImmediately: (BOOL)deliverImmediately
for: (id<GDNCClient>)client;
- (void) removeObserver: (GDNCObserver*)observer;
@ -693,11 +693,11 @@ ihandler(int sig)
RELEASE(info);
}
- (void) postNotificationName: (NSString*)notificationName
object: (NSString*)notificationObject
userInfo: (NSData*)d
deliverImmediately: (BOOL)deliverImmediately
for: (id<GDNCClient>)client
- (oneway void) postNotificationName: (NSString*)notificationName
object: (NSString*)notificationObject
userInfo: (NSData*)d
deliverImmediately: (BOOL)deliverImmediately
for: (id<GDNCClient>)client
{
NSMutableArray *observers = [NSMutableArray array];
NSMutableArray *byName;