changeset 455:7250e91f0662

Some additional flush enforcement to attempt to avoid some possible problems
author Sebastien Decugis <sdecugis@nict.go.jp>
date Thu, 29 Jul 2010 16:42:29 +0900
parents f1484823cb4a
children 478173cb832a
files freeDiameter/cnxctx.c freeDiameter/p_out.c freeDiameter/routing_dispatch.c freeDiameter/sctps.c
diffstat 4 files changed, 17 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/freeDiameter/cnxctx.c	Thu Jul 29 16:11:12 2010 +0900
+++ b/freeDiameter/cnxctx.c	Thu Jul 29 16:42:29 2010 +0900
@@ -690,6 +690,7 @@
 		}
 		
 		/* We have received a complete message, pass it to the daemon */
+		fd_cpu_flush_cache();
 		CHECK_FCT_DO( fd_event_send( Target_Queue(conn), FDEVP_CNX_MSG_RECV, length, newmsg), /* continue or destroy everything? */);
 		
 	} while (conn->cc_loop);
@@ -740,6 +741,7 @@
 			continue;
 		}
 		
+		fd_cpu_flush_cache();
 		CHECK_FCT_DO( fd_event_send( Target_Queue(conn), event, bufsz, buf), goto fatal );
 		
 	} while (conn->cc_loop || (event != FDEVP_CNX_MSG_RECV));
@@ -924,6 +926,7 @@
 		}
 		
 		/* We have received a complete message, pass it to the daemon */
+		fd_cpu_flush_cache();
 		CHECK_FCT_DO( ret = fd_event_send( Target_Queue(conn), FDEVP_CNX_MSG_RECV, length, newmsg), 
 			{ 
 				free(newmsg); 
--- a/freeDiameter/p_out.c	Thu Jul 29 16:11:12 2010 +0900
+++ b/freeDiameter/p_out.c	Thu Jul 29 16:42:29 2010 +0900
@@ -121,9 +121,11 @@
 		/* Send the message, log any error */
 		CHECK_FCT_DO( do_send(&msg, 0, peer->p_cnxctx, &peer->p_hbh, &peer->p_sr),
 			{
-				fd_log_debug("An error occurred while sending this message, it is lost:\n");
-				fd_msg_dump_walk(NONE, msg);
-				fd_msg_free(msg);
+				if (msg) {
+					fd_log_debug("An error occurred while sending this message, it was lost:\n");
+					fd_msg_dump_walk(NONE, msg);
+					fd_msg_free(msg);
+				}
 			} );
 			
 		/* Loop */
@@ -160,10 +162,12 @@
 		/* Do send the message */
 		CHECK_FCT_DO( do_send(msg, flags, cnx, hbh, peer ? &peer->p_sr : NULL),
 			{
-				fd_log_debug("An error occurred while sending this message, it is lost:\n");
-				fd_msg_dump_walk(NONE, *msg);
-				fd_msg_free(*msg);
-				*msg = NULL;
+				if (msg) {
+					fd_log_debug("An error occurred while sending this message, it was lost:\n");
+					fd_msg_dump_walk(NONE, *msg);
+					fd_msg_free(*msg);
+					*msg = NULL;
+				}
 			} );
 	}
 	
--- a/freeDiameter/routing_dispatch.c	Thu Jul 29 16:11:12 2010 +0900
+++ b/freeDiameter/routing_dispatch.c	Thu Jul 29 16:42:29 2010 +0900
@@ -997,6 +997,7 @@
 	
 	/* Mark the thread running */
 	*(enum thread_state *)arg = RUNNING;
+	fd_cpu_flush_cache();
 	
 	do {
 		struct msg * msg;
@@ -1123,6 +1124,7 @@
 	CHECK_PARAMS_DO(st && thr, return);
 
 	/* Wait for a second for the thread to complete, by monitoring my_state */
+	fd_cpu_flush_cache();
 	if (*st != TERMINATED) {
 		TRACE_DEBUG(INFO, "Waiting for the %s thread to have a chance to terminate", th_name);
 		do {
--- a/freeDiameter/sctps.c	Thu Jul 29 16:11:12 2010 +0900
+++ b/freeDiameter/sctps.c	Thu Jul 29 16:42:29 2010 +0900
@@ -101,6 +101,7 @@
 				
 			case FDEVP_CNX_EP_CHANGE:
 				/* Send this event to the target queue */
+				fd_cpu_flush_cache();
 				CHECK_FCT_DO( fd_event_send( Target_Queue(conn), event, bufsz, buf), goto fatal );
 				break;
 			
"Welcome to our mercurial repository"