rajrutu / jain-sip

Automatically exported from code.google.com/p/jain-sip
0 stars 0 forks source link

Function computeContentLength (javascript) can give wrong results #119

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
1. In SIPMessage class the result is wrong when special characters (like 
‘é’,’à’) are given (encoding problem).
In case of String, the function counts the number of characters instead of the 
number of Byte which are used.
Consequence, when a SIPMessage is created, content-length computed is too low.
In Java, this problem seems to be already solved with a getBytes. 

2. Conditional clause: if ( content instanceof String ), is not used. In most 
case, content is a “string” and not an object “String”.
(To solve it : if ( content.constructor.name == "String") may be used.)

Original issue reported on code.google.com by Didier.n...@gmail.com on 4 Jul 2013 at 12:48

GoogleCodeExporter commented 8 years ago

Original comment by jean.deruelle on 4 Jul 2013 at 2:57

GoogleCodeExporter commented 8 years ago
Fixed in r6ea34b9df68b

Original comment by jean.deruelle on 6 Sep 2013 at 7:31