Hi, when Kamailio/SER parses a number (like Content-Length value) I assume it doesn't use atoi() or strol() C core functions as they are too much flexible (allow negative values, hexadecimal notation) and worse: they search until a char is not suitable for an integer/long. A bit dangerous as when parsing a stream we don't know if the next position in memory contains a digit or not.
So could I be pointed to the exact function in Kamailio/SER code converting the Content-Length string value (pointer + lentgh) to an integer?
Thanks a lot.
2010/12/30 Iñaki Baz Castillo ibc@aliax.net:
So could I be pointed to the exact function in Kamailio/SER code converting the Content-Length string value (pointer + lentgh) to an integer?
Found:
parser/parse_content.c
:)