diff options
author | Benny Prijono <bennylp@teluu.com> | 2006-05-17 21:24:14 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2006-05-17 21:24:14 +0000 |
commit | 52b02186307a72316526750647693f9f21d08c4f (patch) | |
tree | 2cd71857e4b22a7736e7bed78094326bba8e7149 /pjsip | |
parent | 1b3863ac6dcae1a7bed7e0b0cb6a2f482c093989 (diff) |
Changed the way Content-Type is written. Whitespace is now written before the number because some UAs are protesting otherwise
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@453 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip')
-rw-r--r-- | pjsip/src/pjsip/sip_msg.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/pjsip/src/pjsip/sip_msg.c b/pjsip/src/pjsip/sip_msg.c index 0a173193..75dfd7b5 100644 --- a/pjsip/src/pjsip/sip_msg.c +++ b/pjsip/src/pjsip/sip_msg.c @@ -364,6 +364,7 @@ PJ_DEF(pj_ssize_t) pjsip_msg_print( const pjsip_msg *msg, /* Process message body. */ if (msg->body) { + enum { CLEN_SPACE = 12 }; char *clen_pos = NULL; /* Automaticly adds Content-Type and Content-Length headers, only @@ -396,9 +397,9 @@ PJ_DEF(pj_ssize_t) pjsip_msg_print( const pjsip_msg *msg, * the content length value after we know the length of the * body. */ - pj_memset(p, ' ', 12); + pj_memset(p, ' ', CLEN_SPACE); clen_pos = p; - p += 12; + p += CLEN_SPACE; *p++ = '\r'; *p++ = '\n'; } @@ -418,8 +419,9 @@ PJ_DEF(pj_ssize_t) pjsip_msg_print( const pjsip_msg *msg, * Content-Length header. */ if (clen_pos) { - len = pj_utoa(len, clen_pos); - clen_pos[len] = ' '; + char tmp[CLEN_SPACE]; + len = pj_utoa(len, tmp); + pj_memcpy(clen_pos+CLEN_SPACE-len, tmp, len); } } else { |