[reSIProcate] Printing parameters in ExtensionHeader

david Butcher davidlbutcher at gmail.com
Sun Jan 22 23:00:48 CST 2006


What Jason said, except the c_str() is rendundant.

cerr << Data::from(*msg);

david

On 1/21/06, Jason Fischl <jason at counterpath.com> wrote:
>
> > --------------------------------------------------
> > char* msg2str(SipMessage* msg){
> >
> >         resip::Data& DatatoSend = msg->getEncoded();
> >         DatatoSend.clear();
> >         resip::DataStream encodeStream(DatatoSend);
> >         msg->encode(encodeStream);
> >         encodeStream.flush();   // pronto per partire
> >
> >         return (char*)DatatoSend.c_str();
> > }
>
> You are returning a pointer to stack memory that is going out of scope
> when the function returns. I think what you want is the following
> instead.
>
> SipMessage msg;
> cerr << Data::from(msg).c_str();
>
> Jason
> _______________________________________________
> resiprocate-devel mailing list
> resiprocate-devel at list.sipfoundry.org
> https://list.sipfoundry.org/mailman/listinfo/resiprocate-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.resiprocate.org/pipermail/resiprocate-devel/attachments/20060122/f92bb7e7/attachment.htm>


More information about the resiprocate-devel mailing list