diff libfdproto/messages.c @ 924:877592751fee

Fix (tentative) for invalid handling of sessions fast creation/destruction as pointed by Yusuke Okura -- http://lists.freediameter.net/pipermail/help/2013-February/000584.html and http://lists.freediameter.net/pipermail/help/2013-February/000589.html -- Thank you very much
author Sebastien Decugis <sdecugis@freediameter.net>
date Thu, 14 Feb 2013 17:52:57 +0100
parents cb439d57d0c5
children 5053f1abcf5d f97fa305467f
line wrap: on
line diff
--- a/libfdproto/messages.c	Thu Feb 14 15:58:55 2013 +0100
+++ b/libfdproto/messages.c	Thu Feb 14 17:52:57 2013 +0100
@@ -1215,6 +1215,20 @@
 	return 0;
 }
 
+/* Associate a session with a message, use only when the session was just created */
+int fd_msg_sess_set(struct msg * msg, struct session * session)
+{
+	TRACE_ENTRY("%p %p", msg, session);
+	
+	/* Check we received valid parameters */
+	CHECK_PARAMS( CHECK_MSG(msg) );
+	CHECK_PARAMS( session );
+	CHECK_PARAMS( msg->msg_sess == NULL );
+	
+	msg->msg_sess = session;
+	return 0;
+}
+
 
 /* Retrieve the session of the message */
 int fd_msg_sess_get(struct dictionary * dict, struct msg * msg, struct session ** session, int * new)
"Welcome to our mercurial repository"