changeset 1009:e22434c66126

Be more restrictive on fd_msg_send() called with answer messages, the function now rejects the parameters if an answer callback is provided
author Sebastien Decugis <sdecugis@freediameter.net>
date Mon, 25 Mar 2013 14:35:55 +0100
parents d3d2a32320c4
children 357c2f892d24
files libfdproto/messages.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libfdproto/messages.c	Fri Mar 22 14:48:28 2013 +0100
+++ b/libfdproto/messages.c	Mon Mar 25 14:35:55 2013 +0100
@@ -1037,7 +1037,7 @@
 	CHECK_PARAMS( CHECK_MSG(msg) );
 	
 	if (! (msg->msg_public.msg_flags & CMD_FLAG_REQUEST ))
-		return 0; /* we associate with requests only */
+		return anscb ? EINVAL : 0; /* we associate with requests only */
 	
 	CHECK_PARAMS( (anscb == NULL) || (msg->msg_cb.fct == NULL) ); /* We are not overwritting a cb */
 	
"Welcome to our mercurial repository"