Module: sip-router Branch: master Commit: 2f213e313a86e16665f6d0acfec959bf23f72b7d URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=2f213e31...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: Fri Sep 20 11:15:16 2013 +0200
registrar: if rcv_parm value is empty, don't add received to contacts in 200ok reply
- otherwise results in malformed value
---
modules/registrar/reply.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/modules/registrar/reply.c b/modules/registrar/reply.c index 28588fa..93c86a8 100644 --- a/modules/registrar/reply.c +++ b/modules/registrar/reply.c @@ -111,7 +111,7 @@ static inline unsigned int calc_buf_len(ucontact_t* c, str *host, int mode) qlen = len_q(c->q); if (qlen) len += Q_PARAM_LEN + qlen; len += EXPIRES_PARAM_LEN + INT2STR_MAX_LEN; - if (c->received.s) { + if (rcv_param.len>0 && c->received.s) { len += 1 /* ; */ + rcv_param.len + 1 /* = */ @@ -252,7 +252,7 @@ int build_contact(sip_msg_t *msg, ucontact_t* c, str *host) memcpy(p, cp, len); p += len;
- if (c->received.s) { + if (rcv_param.len>0 && c->received.s) { *p++ = ';'; memcpy(p, rcv_param.s, rcv_param.len); p += rcv_param.len;