comparison libfreeDiameter/messages.c @ 649:5e5d8152c229

Implemented fd_msg_send_timeout to close #10. Not tested yet.
author Sebastien Decugis <sdecugis@nict.go.jp>
date Wed, 05 Jan 2011 17:13:34 +0900
parents ae29bf971f20
children 5b05d85682f1
comparison
equal deleted inserted replaced
648:ae29bf971f20 649:5e5d8152c229
916 /* Associate callback and data with the message, if any */ 916 /* Associate callback and data with the message, if any */
917 msg->msg_cb.fct = anscb; 917 msg->msg_cb.fct = anscb;
918 msg->msg_cb.data = data; 918 msg->msg_cb.data = data;
919 if (timeout) { 919 if (timeout) {
920 memcpy(&msg->msg_cb.timeout, timeout, sizeof(struct timespec)); 920 memcpy(&msg->msg_cb.timeout, timeout, sizeof(struct timespec));
921 } else {
922 memset(&msg->msg_cb.timeout, 0, sizeof(struct timespec)); /* clear the area */
923 } 921 }
924 922
925 return 0; 923 return 0;
926 } 924 }
927 925
935 /* Copy the result */ 933 /* Copy the result */
936 *anscb = msg->msg_cb.fct; 934 *anscb = msg->msg_cb.fct;
937 *data = msg->msg_cb.data; 935 *data = msg->msg_cb.data;
938 936
939 return 0; 937 return 0;
940 } 938 }
939
940 struct timespec *fd_msg_anscb_gettimeout( struct msg * msg )
941 {
942 TRACE_ENTRY("%p", msg);
943
944 /* Check the parameters */
945 CHECK_PARAMS_DO( CHECK_MSG(msg), return NULL );
946
947 if (!msg->msg_cb.timeout.tv_sec) {
948 return NULL;
949 }
950
951 return &msg->msg_cb.timeout;
952 }
941 953
942 /* Associate routing lists */ 954 /* Associate routing lists */
943 int fd_msg_rt_associate( struct msg * msg, struct rt_data ** rtd ) 955 int fd_msg_rt_associate( struct msg * msg, struct rt_data ** rtd )
944 { 956 {
945 TRACE_ENTRY( "%p %p", msg, rtd ); 957 TRACE_ENTRY( "%p %p", msg, rtd );
"Welcome to our mercurial repository"