On date Wednesday 2008-09-24 15:46:21 +0200, elisa_murgia phoned this: > ---------- Initial Header ----------- > > >From : "elisa_murgia" [EMAIL PROTECTED] > To : "sofia-sip-devel" sofia-sip-devel@lists.sourceforge.net > Cc : > Date : Wed, 24 Sep 2008 12:31:47 +0200 > Subject : Re: [Sofia-sip-devel] Using SOFIA-SIP just as a parser > > Another thing I noticed: > > I've made a test putting an incomplete sip-message inside a string and then > > msg_t* msg=msg_make(...) > > int i=msg_extract(msg); > > > Now msg_extract returns always 1, as it was complete. I'd expected a 0. > More: making > > sip_t sip=sip_object(msg); > > with some full fields and others empty. > > How is it possible??
>From sofia-sip documentation: |msg_t* msg_make(msg_mclass_t const *mc, | intflags, | void const *data, | ssize_tlen) | |Parse a text message with parser mc. The data is copied and it is not modified or referenced by the parsed message. [...] |Return values: | A pointer to a freshly allocated and parsed message. | |Upon parsing error, the header structure may be left incomplete. The |MSG_FLG_ERROR is set in msg_object(msg)->msg_flags. So you have to check that flag to understand if the parsing went fine. Behaviour of msg_extract() with an incomplete msg_t is undefined, at least I think so. [...] Regards. -- Stefano Sabatini http://www.reilabs.com ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Sofia-sip-devel mailing list Sofia-sip-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel