comparison libfdproto/messages.c @ 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 1b0b1ab77be5
children 908ffbb81f60
comparison
equal deleted inserted replaced
1008:d3d2a32320c4 1009:e22434c66126
1035 1035
1036 /* Check the parameters */ 1036 /* Check the parameters */
1037 CHECK_PARAMS( CHECK_MSG(msg) ); 1037 CHECK_PARAMS( CHECK_MSG(msg) );
1038 1038
1039 if (! (msg->msg_public.msg_flags & CMD_FLAG_REQUEST )) 1039 if (! (msg->msg_public.msg_flags & CMD_FLAG_REQUEST ))
1040 return 0; /* we associate with requests only */ 1040 return anscb ? EINVAL : 0; /* we associate with requests only */
1041 1041
1042 CHECK_PARAMS( (anscb == NULL) || (msg->msg_cb.fct == NULL) ); /* We are not overwritting a cb */ 1042 CHECK_PARAMS( (anscb == NULL) || (msg->msg_cb.fct == NULL) ); /* We are not overwritting a cb */
1043 1043
1044 /* Associate callback and data with the message, if any */ 1044 /* Associate callback and data with the message, if any */
1045 msg->msg_cb.fct = anscb; 1045 msg->msg_cb.fct = anscb;
"Welcome to our mercurial repository"