Mercurial > hg > freeDiameter
comparison libfdcore/p_out.c @ 1113:eb4ce68b6e5c
Added calls to remaining hooks
author | Sebastien Decugis <sdecugis@freediameter.net> |
---|---|
date | Mon, 13 May 2013 19:17:13 +0800 |
parents | d8591b1c56cd |
children | 79dd22145f52 |
comparison
equal
deleted
inserted
replaced
1112:d87cee14b051 | 1113:eb4ce68b6e5c |
---|---|
95 static void cleanup_requeue(void * arg) | 95 static void cleanup_requeue(void * arg) |
96 { | 96 { |
97 struct msg *msg = arg; | 97 struct msg *msg = arg; |
98 CHECK_FCT_DO(fd_fifo_post(fd_g_outgoing, &msg), | 98 CHECK_FCT_DO(fd_fifo_post(fd_g_outgoing, &msg), |
99 { | 99 { |
100 //fd_msg_log( FD_MSG_LOG_DROPPED, msg, "An error occurred while attempting to requeue this message during cancellation of the sending function"); | 100 fd_hook_call(HOOK_MESSAGE_DROPPED, msg, NULL, "An error occurred while attempting to requeue this message during cancellation of the sending function", fd_msg_pmdl_get(msg)); |
101 CHECK_FCT_DO(fd_msg_free(msg), /* What can we do more? */); | 101 CHECK_FCT_DO(fd_msg_free(msg), /* What can we do more? */); |
102 } ); | 102 } ); |
103 } | 103 } |
104 | 104 |
105 /* The code of the "out" thread */ | 105 /* The code of the "out" thread */ |
128 | 128 |
129 /* Send the message, log any error */ | 129 /* Send the message, log any error */ |
130 CHECK_FCT_DO( ret = do_send(&msg, 0, peer->p_cnxctx, &peer->p_hbh, peer), | 130 CHECK_FCT_DO( ret = do_send(&msg, 0, peer->p_cnxctx, &peer->p_hbh, peer), |
131 { | 131 { |
132 if (msg) { | 132 if (msg) { |
133 //fd_msg_log( FD_MSG_LOG_DROPPED, msg, "Internal error: Problem while sending (%s)", strerror(ret) ); | 133 char buf[256]; |
134 snprintf(buf, sizeof(buf), "Error while sending this message: s", strerror(ret)); | |
135 fd_hook_call(HOOK_MESSAGE_DROPPED, msg, NULL, buf, fd_msg_pmdl_get(msg)); | |
134 fd_msg_free(msg); | 136 fd_msg_free(msg); |
135 } | 137 } |
136 } ); | 138 } ); |
137 | 139 |
138 /* Loop */ | 140 /* Loop */ |
180 | 182 |
181 /* Do send the message */ | 183 /* Do send the message */ |
182 CHECK_FCT_DO( ret = do_send(msg, flags, cnx, hbh, peer), | 184 CHECK_FCT_DO( ret = do_send(msg, flags, cnx, hbh, peer), |
183 { | 185 { |
184 if (msg) { | 186 if (msg) { |
185 //fd_msg_log( FD_MSG_LOG_DROPPED, *msg, "Internal error: Problem while sending (%s)", strerror(ret) ); | 187 char buf[256]; |
188 snprintf(buf, sizeof(buf), "Error while sending this message: s", strerror(ret)); | |
189 fd_hook_call(HOOK_MESSAGE_DROPPED, *msg, NULL, buf, fd_msg_pmdl_get(*msg)); | |
186 fd_msg_free(*msg); | 190 fd_msg_free(*msg); |
187 *msg = NULL; | 191 *msg = NULL; |
188 } | 192 } |
189 } ); | 193 } ); |
190 } | 194 } |