On 4/5/06, Marcin Michalak <[EMAIL PROTECTED]> wrote: > Hello, > I managed to put the message structure into the buffer, but the > sequence seems to be different for 2 different messages: .. > How to make sure the sequence is the same?
msg_copy() does that. msg_dup() can not keep the sequence between different headers. The problem is headers like Allow, Require or Supported or Content-Encoding. Usually, they contain a comma-separated list of tokens: Allow: INVITE, BYE, ACK, CANCEL, OPTIONS Require: foo, baz Supported: bar, xyzzy However, each header can be on its own line multiple times, like this: Allow: INVITE Require: foo Allow: BYE Supported: bar Allow: ACK Require: baz Allow: CANCEL Supported: xyzzy Allow: OPTIONS and so on. Sofia-SIP parser joins all of the values of different Allow headers in a single array of strings in a single msg_list_t structure (likewise, it does with Supported and Require headers). Parser also inserts shadow msg_list_t structures that are just placeholders for caching the unparsed data. They are needed so that the original msg and msg_copy()ied msg can remember the original message representation. When you do msg_dup(), the cached data is not copied nor the shadow structures. --Pekka -- Pekka.Pessi mail at nokia.com ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642 _______________________________________________ Sofia-sip-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel
