diff 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
line wrap: on
line diff
--- a/libfdcore/p_out.c	Mon May 13 18:50:26 2013 +0800
+++ b/libfdcore/p_out.c	Mon May 13 19:17:13 2013 +0800
@@ -97,7 +97,7 @@
 	struct msg *msg = arg;
 	CHECK_FCT_DO(fd_fifo_post(fd_g_outgoing, &msg),
 		{
-			//fd_msg_log( FD_MSG_LOG_DROPPED, msg, "An error occurred while attempting to requeue this message during cancellation of the sending function");
+			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));
 			CHECK_FCT_DO(fd_msg_free(msg), /* What can we do more? */);
 		} );
 }
@@ -130,7 +130,9 @@
 		CHECK_FCT_DO( ret = do_send(&msg, 0, peer->p_cnxctx, &peer->p_hbh, peer),
 			{
 				if (msg) {
-					//fd_msg_log( FD_MSG_LOG_DROPPED, msg, "Internal error: Problem while sending (%s)", strerror(ret) );
+					char buf[256];
+					snprintf(buf, sizeof(buf), "Error while sending this message: s", strerror(ret));
+					fd_hook_call(HOOK_MESSAGE_DROPPED, msg, NULL, buf, fd_msg_pmdl_get(msg));
 					fd_msg_free(msg);
 				}
 			} );
@@ -182,7 +184,9 @@
 		CHECK_FCT_DO( ret = do_send(msg, flags, cnx, hbh, peer),
 			{
 				if (msg) {
-					//fd_msg_log( FD_MSG_LOG_DROPPED, *msg, "Internal error: Problem while sending (%s)", strerror(ret) );
+					char buf[256];
+					snprintf(buf, sizeof(buf), "Error while sending this message: s", strerror(ret));
+					fd_hook_call(HOOK_MESSAGE_DROPPED, *msg, NULL, buf, fd_msg_pmdl_get(*msg));
 					fd_msg_free(*msg);
 					*msg = NULL;
 				}
"Welcome to our mercurial repository"