Navigation


Changeset 646:cfc8da9264f4 in freeDiameter for libfreeDiameter/messages.c


Ignore:
Timestamp:
Jan 4, 2011, 4:20:50 PM (13 years ago)
Author:
Sebastien Decugis <sdecugis@nict.go.jp>
Branch:
default
Phase:
public
Message:

Prepared first part of the changes for #10

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libfreeDiameter/messages.c

    r638 r646  
    124124                        void (*fct)(void *, struct msg **);
    125125                        void * data;
     126                        struct timespec timeout;
    126127                }                msg_cb;                /* Callback to be called when an answer is received, if not NULL */
    127128        char *                   msg_src_id;            /* Diameter Id of the peer this message was received from. This string is malloc'd and must be freed */
     
    904905
    905906/* Associate / get answer callbacks */
    906 int fd_msg_anscb_associate( struct msg * msg, void ( *anscb)(void *, struct msg **), void  * data )
     907int fd_msg_anscb_associate( struct msg * msg, void ( *anscb)(void *, struct msg **), void  * data, const struct timespec *timeout )
    907908{
    908909        TRACE_ENTRY("%p %p %p", msg, anscb, data);
     
    916917        msg->msg_cb.fct = anscb;
    917918        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        }
    918924       
    919925        return 0;
Note: See TracChangeset for help on using the changeset viewer.