Navigation


Changeset 1014:908ffbb81f60 in freeDiameter for libfdcore/messages.c


Ignore:
Timestamp:
Mar 29, 2013, 6:30:59 PM (11 years ago)
Author:
Sebastien Decugis <sdecugis@freediameter.net>
Branch:
default
Phase:
public
Message:

Added a second callback in fd_msg_send_timeout to handle more easily the timeout situation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libfdcore/messages.c

    r928 r1014  
    321321       
    322322        /* Save the callback in the message */
    323         CHECK_FCT(  fd_msg_anscb_associate( *pmsg, anscb, data, NULL /* we should maybe use a safeguard here like 1 hour or so? */ )  );
     323        CHECK_FCT(  fd_msg_anscb_associate( *pmsg, anscb, data, NULL, NULL /* we should maybe use a safeguard here like 1 hour or so? */ )  );
    324324       
    325325        /* Post the message in the outgoing queue */
     
    330330
    331331/* The variation of the same function with a timeout callback */
    332 int fd_msg_send_timeout ( struct msg ** pmsg, void (*anscb)(void *, struct msg **), void * data, const struct timespec *timeout )
    333 {
    334         TRACE_ENTRY("%p %p %p", pmsg, anscb, data, timeout);
    335         CHECK_PARAMS( pmsg && anscb && timeout );
     332int fd_msg_send_timeout ( struct msg ** pmsg, void (*anscb)(void *, struct msg **), void * data, void (*expirecb)(void *, DiamId_t, size_t, struct msg **), const struct timespec *timeout )
     333{
     334        TRACE_ENTRY("%p %p %p %p %p", pmsg, anscb, data, expirecb, timeout);
     335        CHECK_PARAMS( pmsg && expirecb && timeout );
    336336       
    337337        /* Save the callback in the message, with the timeout */
    338         CHECK_FCT(  fd_msg_anscb_associate( *pmsg, anscb, data, timeout )  );
     338        CHECK_FCT(  fd_msg_anscb_associate( *pmsg, anscb, data, expirecb, timeout )  );
    339339       
    340340        /* Post the message in the outgoing queue */
Note: See TracChangeset for help on using the changeset viewer.