Hi Roberto, Yes, you are right. Your patch should be sufficient to accommodate your case. Regards, Ming On Mon, Apr 28, 2014 at 9:07 PM, Roberto Fichera <kernel at tekno-soft.it>wrote: > Hi All, > > playing with instant messaging I've found a problem regarding > the calculation of the header content length field, basically it seems > that there is space to only 5 digits when composing string to account > the body size. I've notice this while inspecting the SIP packet which was > reporting for example 108532 as > > Content-Length: 10853 > > so only the first 5 digits seems written in the header. Does the patch > below > make sense then to at least have 6 digits max available? A real patch > should > take in account the max packet length and reserve the given space to > represent > it. > > Best regards, > Roberto Fichera. > > diff --git a/pjsip/src/pjsip/sip_msg.c b/pjsip/src/pjsip/sip_msg.c > index 0ec56ad..bc059b3 100644 > --- a/pjsip/src/pjsip/sip_msg.c > +++ b/pjsip/src/pjsip/sip_msg.c > @@ -476,7 +476,7 @@ PJ_DEF(pj_ssize_t) pjsip_msg_print( const pjsip_msg > *msg, > > /* Process message body. */ > if (msg->body) { > - enum { CLEN_SPACE = 5 }; > + enum { CLEN_SPACE = 6 }; > char *clen_pos = NULL; > > /* Automaticly adds Content-Type and Content-Length headers, only > > > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip at lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20140430/0793ee3a/attachment.html>