[sr-dev] git:master: dialog(k): populate bind addr before any error

Daniel-Constantin Mierla miconda at gmail.com
Thu Apr 22 10:38:30 CEST 2010


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

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Thu Apr 22 10:35:33 2010 +0200

dialog(k): populate bind addr before any error

- setting bind addr attribute in populate_leg_info() takes place before
  any parsing error may occur, to be sure it is set, avoiding extra
  check for null value when updating db
- reported by Kelvin Chua
- credits to Timo Reimann for troubleshooting

---

 modules_k/dialog/dlg_handlers.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/modules_k/dialog/dlg_handlers.c b/modules_k/dialog/dlg_handlers.c
index 1091777..3b671ab 100644
--- a/modules_k/dialog/dlg_handlers.c
+++ b/modules_k/dialog/dlg_handlers.c
@@ -200,6 +200,8 @@ int populate_leg_info( struct dlg_cell *dlg, struct sip_msg *msg,
 	str contact;
 	str rr_set;
 
+	dlg->bind_addr[leg] = msg->rcv.bind_address;
+
 	/* extract the cseq number as string */
 	if (leg==DLG_CALLER_LEG) {
 		if((!msg->cseq && (parse_headers(msg,HDR_CSEQ_F,0)<0 || !msg->cseq))
@@ -269,7 +271,6 @@ int populate_leg_info( struct dlg_cell *dlg, struct sip_msg *msg,
 		goto error0;
 	}
 
-	dlg->bind_addr[leg] = msg->rcv.bind_address;
 	if (rr_set.s) pkg_free(rr_set.s);
 
 	return 0;




More information about the sr-dev mailing list