Mercurial > hg > freeDiameter
diff 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 |
line wrap: on
line diff
--- a/libfreeDiameter/messages.c Tue Jan 04 16:21:26 2011 +0900 +++ b/libfreeDiameter/messages.c Wed Jan 05 17:13:34 2011 +0900 @@ -918,8 +918,6 @@ msg->msg_cb.data = data; if (timeout) { memcpy(&msg->msg_cb.timeout, timeout, sizeof(struct timespec)); - } else { - memset(&msg->msg_cb.timeout, 0, sizeof(struct timespec)); /* clear the area */ } return 0; @@ -937,7 +935,21 @@ *data = msg->msg_cb.data; return 0; -} +} + +struct timespec *fd_msg_anscb_gettimeout( struct msg * msg ) +{ + TRACE_ENTRY("%p", msg); + + /* Check the parameters */ + CHECK_PARAMS_DO( CHECK_MSG(msg), return NULL ); + + if (!msg->msg_cb.timeout.tv_sec) { + return NULL; + } + + return &msg->msg_cb.timeout; +} /* Associate routing lists */ int fd_msg_rt_associate( struct msg * msg, struct rt_data ** rtd )