Changes in libfdcore/messages.c [1103:d8591b1c56cd:1113:eb4ce68b6e5c] in freeDiameter
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libfdcore/messages.c
r1103 r1113 314 314 } 315 315 316 static int fd_msg_send_int( struct msg ** pmsg, void (*anscb)(void *, struct msg **), void * data, void (*expirecb)(void *, DiamId_t, size_t, struct msg **), const struct timespec *timeout ) 317 { 318 struct msg_hdr *hdr; 319 DiamId_t diamid; 320 size_t diamidlen; 321 322 /* Save the callback in the message, with the timeout */ 323 CHECK_FCT( fd_msg_anscb_associate( *pmsg, anscb, data, expirecb, timeout ) ); 324 325 /* If this is a new request, call the HOOK_MESSAGE_LOCAL hook */ 326 if ( (fd_msg_hdr(*pmsg, &hdr) == 0) 327 && (hdr->msg_flags & CMD_FLAG_REQUEST) 328 && (fd_msg_source_get(*pmsg, &diamid, &diamidlen) == 0) 329 && (diamid == NULL)) { 330 fd_hook_call(HOOK_MESSAGE_LOCAL, *pmsg, NULL, NULL, fd_msg_pmdl_get(*pmsg)); 331 } 332 333 /* Post the message in the outgoing queue */ 334 CHECK_FCT( fd_fifo_post(fd_g_outgoing, pmsg) ); 335 336 return 0; 337 } 338 316 339 /* Send a message and optionaly register a callback for an answer */ 317 340 int fd_msg_send ( struct msg ** pmsg, void (*anscb)(void *, struct msg **), void * data ) … … 320 343 CHECK_PARAMS( pmsg ); 321 344 322 /* Save the callback in the message */ 323 CHECK_FCT( fd_msg_anscb_associate( *pmsg, anscb, data, NULL, NULL /* we should maybe use a safeguard here like 1 hour or so? */ ) ); 324 325 /* Post the message in the outgoing queue */ 326 CHECK_FCT( fd_fifo_post(fd_g_outgoing, pmsg) ); 327 328 return 0; 345 return fd_msg_send_int(pmsg, anscb, data, NULL, NULL); 329 346 } 330 347 … … 335 352 CHECK_PARAMS( pmsg && expirecb && timeout ); 336 353 337 /* Save the callback in the message, with the timeout */ 338 CHECK_FCT( fd_msg_anscb_associate( *pmsg, anscb, data, expirecb, timeout ) ); 339 340 /* Post the message in the outgoing queue */ 341 CHECK_FCT( fd_fifo_post(fd_g_outgoing, pmsg) ); 342 343 return 0; 354 return fd_msg_send_int(pmsg, anscb, data, expirecb, timeout); 344 355 } 345 356
Note: See TracChangeset
for help on using the changeset viewer.