# HG changeset patch # User Sebastien Decugis # Date 1280389349 -32400 # Node ID 7250e91f0662bc7b7b6414a158acece7193fe6a6 # Parent f1484823cb4abbef576832ac1379f0c3fa2c5e56 Some additional flush enforcement to attempt to avoid some possible problems diff -r f1484823cb4a -r 7250e91f0662 freeDiameter/cnxctx.c --- 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); diff -r f1484823cb4a -r 7250e91f0662 freeDiameter/p_out.c --- 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; + } } ); } diff -r f1484823cb4a -r 7250e91f0662 freeDiameter/routing_dispatch.c --- 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 { diff -r f1484823cb4a -r 7250e91f0662 freeDiameter/sctps.c --- 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;