Mercurial > hg > freeDiameter
comparison libfdproto/messages.c @ 824:89c5849b0832
Allow retransmission of messages on timeout
author | Sebastien Decugis <sdecugis@freediameter.net> |
---|---|
date | Thu, 13 Sep 2012 13:41:29 +0200 |
parents | c0a88c1bcc1e |
children | 254d81d21d0b |
comparison
equal
deleted
inserted
replaced
823:f145c687c5f3 | 824:89c5849b0832 |
---|---|
964 int fd_msg_anscb_associate( struct msg * msg, void ( *anscb)(void *, struct msg **), void * data, const struct timespec *timeout ) | 964 int fd_msg_anscb_associate( struct msg * msg, void ( *anscb)(void *, struct msg **), void * data, const struct timespec *timeout ) |
965 { | 965 { |
966 TRACE_ENTRY("%p %p %p", msg, anscb, data); | 966 TRACE_ENTRY("%p %p %p", msg, anscb, data); |
967 | 967 |
968 /* Check the parameters */ | 968 /* Check the parameters */ |
969 CHECK_PARAMS( CHECK_MSG(msg) && anscb ); | 969 CHECK_PARAMS( CHECK_MSG(msg) ); |
970 CHECK_PARAMS( msg->msg_public.msg_flags & CMD_FLAG_REQUEST ); /* we associate with requests only */ | 970 CHECK_PARAMS( msg->msg_public.msg_flags & CMD_FLAG_REQUEST ); /* we associate with requests only */ |
971 CHECK_PARAMS( msg->msg_cb.fct == NULL ); /* No cb is already registered */ | 971 CHECK_PARAMS( (anscb == NULL) || (msg->msg_cb.fct == NULL) ); /* We are not overwritting a cb */ |
972 | 972 |
973 /* Associate callback and data with the message, if any */ | 973 /* Associate callback and data with the message, if any */ |
974 msg->msg_cb.fct = anscb; | 974 msg->msg_cb.fct = anscb; |
975 msg->msg_cb.data = data; | 975 msg->msg_cb.data = data; |
976 if (timeout) { | 976 if (timeout) { |