[asterisk-commits] mmichelson: branch mmichelson/rls-rlmi r419749 - /team/mmichelson/rls-rlmi/res/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jul 28 16:31:26 CDT 2014


Author: mmichelson
Date: Mon Jul 28 16:31:21 2014
New Revision: 419749

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=419749
Log:
Fix an issue dealing with lists of lists and partial state notifications.

Enabling partial state on an embedded list, prior to this change, would
result in sending an "empty" multipart body if sending a NOTIFY where
none of the embedded list's resources have changed.

This change should fix that by omitting the embedded list from the body
entirely.


Modified:
    team/mmichelson/rls-rlmi/res/res_pjsip_pubsub.c

Modified: team/mmichelson/rls-rlmi/res/res_pjsip_pubsub.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/rls-rlmi/res/res_pjsip_pubsub.c?view=diff&rev=419749&r1=419748&r2=419749
==============================================================================
--- team/mmichelson/rls-rlmi/res/res_pjsip_pubsub.c (original)
+++ team/mmichelson/rls-rlmi/res/res_pjsip_pubsub.c Mon Jul 28 16:31:21 2014
@@ -1812,11 +1812,16 @@
 
 	AST_VECTOR_INIT(&body_parts, AST_VECTOR_SIZE(&sub->children));
 
-	multipart = create_multipart_body(pool);
-
 	for (i = 0; i < AST_VECTOR_SIZE(&sub->children); ++i) {
 		build_body_part(pool, AST_VECTOR_GET(&sub->children, i), &body_parts, use_full_state);
 	}
+
+	/* This can happen if issuing partial state and no children of the list have changed state */
+	if (AST_VECTOR_SIZE(&body_parts) == 0) {
+		return NULL;
+	}
+
+	multipart = create_multipart_body(pool);
 
 	rlmi_part = build_rlmi_body(pool, sub, &body_parts, use_full_state);
 	pjsip_multipart_add_part(pool, multipart, rlmi_part);




More information about the asterisk-commits mailing list