diff freeDiameter/p_out.c @ 208:e1da03ba112f

Force ordering of messages by using only stream 0 for link-local messages -- avoids issue of DWR arriving before CEA.
author Sebastien Decugis <sdecugis@nict.go.jp>
date Mon, 15 Feb 2010 18:16:12 +0900
parents 4679ff581d6a
children 965f5971dc23
line wrap: on
line diff
--- a/freeDiameter/p_out.c	Mon Feb 15 17:36:00 2010 +0900
+++ b/freeDiameter/p_out.c	Mon Feb 15 18:16:12 2010 +0900
@@ -39,7 +39,7 @@
 static int do_send(struct msg ** msg, struct cnxctx * cnx, uint32_t * hbh, struct sr_list * srl)
 {
 	struct msg_hdr * hdr;
-	int msg_is_a_req;
+	int msg_is_a_req, msg_is_appl;
 	uint8_t * buf;
 	size_t sz;
 	int ret;
@@ -59,6 +59,8 @@
 		*hbh = hdr->msg_hbhid + 1;
 	}
 	
+	msg_is_appl = fd_msg_is_routable(*msg);
+	
 	/* Log the message */
 	if (TRACE_BOOL(FULL)) {
 		CHECK_FCT_DO(  fd_msg_update_length(*msg), /* continue */  );
@@ -76,7 +78,7 @@
 	}
 	
 	/* Send the message */
-	CHECK_FCT_DO( ret = fd_cnx_send(cnx, buf, sz), { free(buf); return ret; } );
+	CHECK_FCT_DO( ret = fd_cnx_send(cnx, buf, sz, !msg_is_appl), { free(buf); return ret; } );
 	pthread_cleanup_pop(1);
 	
 	/* Free remaining messages (i.e. answers) */
"Welcome to our mercurial repository"