Module: kamailio Branch: master Commit: dd0b7e403404a977707aa1524783111190cc5f3e URL: https://github.com/kamailio/kamailio/commit/dd0b7e403404a977707aa15247831111...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2016-10-17T12:27:08+02:00
dialog: propre reparse of msg structure when doing cseq refresh ops
- triggering parsing from scratch always resulted in improper propagation of parsing flags and failure to detect end of headers - credits to Jöran Vinzens for assistance with troubleshooting - GH #819
---
Modified: modules/dialog/dlg_cseq.c
---
Diff: https://github.com/kamailio/kamailio/commit/dd0b7e403404a977707aa15247831111... Patch: https://github.com/kamailio/kamailio/commit/dd0b7e403404a977707aa15247831111...
---
diff --git a/modules/dialog/dlg_cseq.c b/modules/dialog/dlg_cseq.c index 4d60180..743a61d 100644 --- a/modules/dialog/dlg_cseq.c +++ b/modules/dialog/dlg_cseq.c @@ -53,12 +53,9 @@ static str _dlg_cseq_diff_var_name = str_init("cseq_diff"); /** * */ -int dlg_cseq_prepare_msg(sip_msg_t *msg) +static int dlg_cseq_prepare_msg(sip_msg_t *msg) { - if (parse_msg(msg->buf, msg->len, msg)!=0) { - LM_DBG("outbuf buffer parsing failed!"); - return 1; - } + LM_DBG("prepare msg for cseq update operations\n");
if(msg->first_line.type==SIP_REQUEST) { if(!IS_SIP(msg)) @@ -109,6 +106,19 @@ int dlg_cseq_prepare_msg(sip_msg_t *msg) /** * */ +static int dlg_cseq_prepare_new_msg(sip_msg_t *msg) +{ + LM_DBG("prepare new msg for cseq update operations\n"); + if (parse_msg(msg->buf, msg->len, msg)!=0) { + LM_DBG("outbuf buffer parsing failed!"); + return 1; + } + return dlg_cseq_prepare_msg(msg); +} + +/** + * + */ int dlg_cseq_update(sip_msg_t *msg) { dlg_cell_t *dlg = NULL; @@ -268,7 +278,7 @@ int dlg_cseq_msg_received(void *data) msg.buf = obuf->s; msg.len = obuf->len;
- if(dlg_cseq_prepare_msg(&msg)!=0) { + if(dlg_cseq_prepare_new_msg(&msg)!=0) { goto done; }
@@ -350,7 +360,7 @@ int dlg_cseq_msg_sent(void *data) msg.buf = obuf->s; msg.len = obuf->len;
- if(dlg_cseq_prepare_msg(&msg)!=0) { + if(dlg_cseq_prepare_new_msg(&msg)!=0) { goto done; }