Changeset 646:cfc8da9264f4 in freeDiameter for libfreeDiameter/messages.c
- Timestamp:
- Jan 4, 2011, 4:20:50 PM (13 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libfreeDiameter/messages.c
r638 r646 124 124 void (*fct)(void *, struct msg **); 125 125 void * data; 126 struct timespec timeout; 126 127 } msg_cb; /* Callback to be called when an answer is received, if not NULL */ 127 128 char * msg_src_id; /* Diameter Id of the peer this message was received from. This string is malloc'd and must be freed */ … … 904 905 905 906 /* Associate / get answer callbacks */ 906 int fd_msg_anscb_associate( struct msg * msg, void ( *anscb)(void *, struct msg **), void * data )907 int fd_msg_anscb_associate( struct msg * msg, void ( *anscb)(void *, struct msg **), void * data, const struct timespec *timeout ) 907 908 { 908 909 TRACE_ENTRY("%p %p %p", msg, anscb, data); … … 916 917 msg->msg_cb.fct = anscb; 917 918 msg->msg_cb.data = data; 919 if (timeout) { 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 } 918 924 919 925 return 0;
Note: See TracChangeset
for help on using the changeset viewer.