[sr-dev] git:master: textopsx: msg_apply_changes() exits config execution if result is not parsing well

Daniel-Constantin Mierla miconda at gmail.com
Fri Aug 15 16:15:32 CEST 2014


Module: sip-router
Branch: master
Commit: 55960106bbaa908057c3f619034b146fda7df48b
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=55960106bbaa908057c3f619034b146fda7df48b

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Fri Aug 15 16:01:38 2014 +0200

textopsx: msg_apply_changes() exits config execution if result is not parsing well

- sip_msg_t structure is can be invalid
- similar behavior with the case when the message is broken from the
  network, it doesn't get to config file
- reported by Marco B.

---

 modules/textopsx/textopsx.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/modules/textopsx/textopsx.c b/modules/textopsx/textopsx.c
index 560f556..7e85013 100644
--- a/modules/textopsx/textopsx.c
+++ b/modules/textopsx/textopsx.c
@@ -228,8 +228,11 @@ static int msg_apply_changes_f(sip_msg_t *msg, char *str1, char *str2)
 	/* reparse the message */
 	LM_DBG("SIP message content updated - reparsing\n");
 	if (parse_msg(msg->buf, msg->len, msg)!=0){
-		LM_ERR("parsing new sip message failed\n");
-		return -1;
+		LM_ERR("parsing new sip message failed [[%.*s]]\n",
+				msg->len, msg->buf);
+		/* exit config execution - sip_msg_t structure is no longer
+		 * valid/safe for config */
+		return 0;
 	}
 
 	return 1;




More information about the sr-dev mailing list