comparison libfdcore/p_sr.c @ 1113:eb4ce68b6e5c

Added calls to remaining hooks
author Sebastien Decugis <sdecugis@freediameter.net>
date Mon, 13 May 2013 19:17:13 +0800
parents a731051d2e83
children 79dd22145f52
comparison
equal deleted inserted replaced
1112:d87cee14b051 1113:eb4ce68b6e5c
116 /* Call it */ 116 /* Call it */
117 (*expirecb)(data, ed->sentto->p_hdr.info.pi_diamid, ed->sentto->p_hdr.info.pi_diamidlen, &ed->request); 117 (*expirecb)(data, ed->sentto->p_hdr.info.pi_diamid, ed->sentto->p_hdr.info.pi_diamidlen, &ed->request);
118 118
119 /* If the callback did not dispose of the message, do it now */ 119 /* If the callback did not dispose of the message, do it now */
120 if (ed->request) { 120 if (ed->request) {
121 //fd_msg_log(FD_MSG_LOG_DROPPED, ed->request, "Expiration period completed without an answer, and the expiry callback did not dispose of the message."); 121 fd_hook_call(HOOK_MESSAGE_DROPPED, ed->request, NULL, "Expiration period completed without an answer, and the expiry callback did not dispose of the message.", fd_msg_pmdl_get(ed->request));
122 CHECK_FCT_DO( fd_msg_free(ed->request), /* ignore */ ); 122 CHECK_FCT_DO( fd_msg_free(ed->request), /* ignore */ );
123 } 123 }
124 124
125 free(ed); 125 free(ed);
126 126
320 /* Set the 'T' flag */ 320 /* Set the 'T' flag */
321 CHECK_FCT_DO(fd_msg_hdr(sr->req, &hdr), /* continue */); 321 CHECK_FCT_DO(fd_msg_hdr(sr->req, &hdr), /* continue */);
322 if (hdr) 322 if (hdr)
323 hdr->msg_flags |= CMD_FLAG_RETRANSMIT; 323 hdr->msg_flags |= CMD_FLAG_RETRANSMIT;
324 324
325 fd_hook_call(HOOK_MESSAGE_FAILOVER, sr->req, (struct fd_peer *)srlist->srs.o, NULL, fd_msg_pmdl_get(sr->req));
326
325 /* Requeue for sending to another peer */ 327 /* Requeue for sending to another peer */
326 CHECK_FCT_DO( ret = fd_fifo_post(fd_g_outgoing, &sr->req), 328 CHECK_FCT_DO( ret = fd_fifo_post(fd_g_outgoing, &sr->req),
327 { 329 {
328 //fd_msg_log( FD_MSG_LOG_DROPPED, sr->req, "Internal error: error while requeuing during failover: %s", strerror(ret) ); 330 char buf[256];
331 snprintf(buf, sizeof(buf), "Internal error: error while requeuing during failover: %s", strerror(ret));
332 fd_hook_call(HOOK_MESSAGE_DROPPED, sr->req, NULL, buf, fd_msg_pmdl_get(sr->req));
329 CHECK_FCT_DO(fd_msg_free(sr->req), /* What can we do more? */) 333 CHECK_FCT_DO(fd_msg_free(sr->req), /* What can we do more? */)
330 }); 334 });
331 } else { 335 } else {
332 /* Just free the request. */ 336 /* Just free the request. */
333 //fd_msg_log( FD_MSG_LOG_DROPPED, sr->req, "Sent & unanswered local message discarded during failover." ); 337 /* fd_hook_call(HOOK_MESSAGE_DROPPED, sr->req, NULL, "Sent & unanswered local message discarded during failover.", fd_msg_pmdl_get(sr->req)); */
334 CHECK_FCT_DO(fd_msg_free(sr->req), /* Ignore */); 338 CHECK_FCT_DO(fd_msg_free(sr->req), /* Ignore */);
335 } 339 }
336 free(sr); 340 free(sr);
337 } 341 }
338 /* The list of expiring requests must be empty now */ 342 /* The list of expiring requests must be empty now */
"Welcome to our mercurial repository"