Module: sip-router Branch: master Commit: 20f4c97f53405b6d74d0e9aa966e6d8cd6fc00a4 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=20f4c97f...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: Mon Aug 16 18:28:03 2010 +0200
core: reason phrase param updated to be str*
- build_res_buf_from_sip_req() takes reply reason phrase parameter as str* - many calls of this function have already the reason length
---
msg_translator.c | 11 ++++------- msg_translator.h | 10 +++++----- 2 files changed, 9 insertions(+), 12 deletions(-)
diff --git a/msg_translator.c b/msg_translator.c index 154c7fe..c96d5b6 100644 --- a/msg_translator.c +++ b/msg_translator.c @@ -1908,7 +1908,7 @@ error: }
-char * build_res_buf_from_sip_req( unsigned int code, char *text ,str *new_tag, +char * build_res_buf_from_sip_req( unsigned int code, str *text ,str *new_tag, struct sip_msg* msg, unsigned int *returned_len, struct bookmark *bmark) { char *buf, *p; @@ -1925,7 +1925,6 @@ char * build_res_buf_from_sip_req( unsigned int code, char *text ,str *new_tag, unsigned int warning_len; char* content_len_buf; unsigned int content_len_len; - unsigned int text_len; char *after_body; str to_tag; char *totags; @@ -1935,8 +1934,6 @@ char * build_res_buf_from_sip_req( unsigned int code, char *text ,str *new_tag, received_buf=rport_buf=warning_buf=content_len_buf=0; received_len=rport_len=warning_len=content_len_len=0;
- text_len=strlen(text); - to_tag.s=0; /* fixes gcc 4.0 warning */ to_tag.len=0;
@@ -1975,7 +1972,7 @@ char * build_res_buf_from_sip_req( unsigned int code, char *text ,str *new_tag,
/* first line */ len += msg->first_line.u.request.version.len + 1/*space*/ + 3/*code*/ + 1/*space*/ + - text_len + CRLF_LEN/*new line*/; + text->len + CRLF_LEN/*new line*/; /*headers that will be copied (TO, FROM, CSEQ,CALLID,VIA)*/ for ( hdr=msg->headers ; hdr ; hdr=hdr->next ) { switch (hdr->type) { @@ -2055,8 +2052,8 @@ char * build_res_buf_from_sip_req( unsigned int code, char *text ,str *new_tag, *(p+i) = '0' + foo - ( foo/10 )*10; p += 3; *(p++) = ' ' ; - memcpy( p , text , text_len ); - p += text_len; + memcpy( p , text->s , text->len ); + p += text->len; memcpy( p, CRLF, CRLF_LEN ); p+=CRLF_LEN; /* headers*/ diff --git a/msg_translator.h b/msg_translator.h index d381f18..33caa40 100644 --- a/msg_translator.h +++ b/msg_translator.h @@ -80,17 +80,17 @@ struct hostport { (hp)->port=&default_global_port; \ }while(0)
-char * build_req_buf_from_sip_req ( struct sip_msg* msg, +char * build_req_buf_from_sip_req(struct sip_msg* msg, unsigned int *returned_len, struct dest_info* send_info, unsigned int mode);
-char * build_res_buf_from_sip_res( struct sip_msg* msg, +char * build_res_buf_from_sip_res(struct sip_msg* msg, unsigned int *returned_len);
-char * build_res_buf_from_sip_req( unsigned int code , - char *text , - str *new_tag , +char * build_res_buf_from_sip_req(unsigned int code, + str *text, + str *new_tag, struct sip_msg* msg, unsigned int *returned_len, struct bookmark *bmark);