[asterisk-commits] mmichelson: branch mmichelson/pubsub_bodies r406035 - /team/mmichelson/pubsub...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jan 21 12:43:58 CST 2014


Author: mmichelson
Date: Tue Jan 21 12:43:52 2014
New Revision: 406035

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=406035
Log:
Fix logic error for MWI body allocation.

Also added some warning messages to body generation.

Modified:
    team/mmichelson/pubsub_bodies/res/res_pjsip_mwi_body_generator.c
    team/mmichelson/pubsub_bodies/res/res_pjsip_pubsub.c

Modified: team/mmichelson/pubsub_bodies/res/res_pjsip_mwi_body_generator.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/pubsub_bodies/res/res_pjsip_mwi_body_generator.c?view=diff&rev=406035&r1=406034&r2=406035
==============================================================================
--- team/mmichelson/pubsub_bodies/res/res_pjsip_mwi_body_generator.c (original)
+++ team/mmichelson/pubsub_bodies/res/res_pjsip_mwi_body_generator.c Tue Jan 21 12:43:52 2014
@@ -47,7 +47,7 @@
 		return NULL;
 	}
 	*mwi_str = ast_str_create(64);
-	if (*mwi_str) {
+	if (!*mwi_str) {
 		ast_free(mwi_str);
 		return NULL;
 	}

Modified: team/mmichelson/pubsub_bodies/res/res_pjsip_pubsub.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/pubsub_bodies/res/res_pjsip_pubsub.c?view=diff&rev=406035&r1=406034&r2=406035
==============================================================================
--- team/mmichelson/pubsub_bodies/res/res_pjsip_pubsub.c (original)
+++ team/mmichelson/pubsub_bodies/res/res_pjsip_pubsub.c Tue Jan 21 12:43:52 2014
@@ -1178,11 +1178,15 @@
 
 	generator = find_body_generator_type_subtype(type, subtype);
 	if (!generator) {
+		ast_log(LOG_WARNING, "Unable to find a body generator for %s/%s\n",
+				type, subtype);
 		return -1;
 	}
 
 	body = generator->allocate_body(data);
 	if (!body) {
+		ast_log(LOG_WARNING, "Unable to allocate a NOTIFY body of type %s/%s\n",
+				type, subtype);
 		return -1;
 	}
 




More information about the asterisk-commits mailing list