[Osip] osip_message_free() callback?
Aymeric Moizard
jack at atosc.org
Tue Feb 19 03:07:44 CET 2008
On Mon, 18 Feb 2008, Eugene M. Kim wrote:
> Hello,
>
> The "application_data" member of osip_message_t seems to be capable of
> storing a per-message pointer. I am trying to use it to attach an
> auxiliary data structure to incoming/outgoing messages, but am having a
> couple of problems with it.
>
> Each incoming message is supposed to be delivered to the message
> callback, so the auxiliary data structure can be freed in the callback
> function. However, for duplicate/resent incoming messages, it seems
> that the original message, not the new one, is supplied to the message
> callback. This causes two things:
>
> 1. Since the auxiliary data structure for the original message has
> already been freed when the original message was first delivered, it is
> now being double-freed.
>
> 2. Since the duplicate message is not delivered to the message callback,
> its auxiliary data structure has no chance to be freed at all, thus a
> memory leak.
>
> A simple solution would be a message free callback (much like the
> kill-transaction callback). But before going ahead and modifying the
> oSIP source code, I would like to know if there is another way to solve
> this problem.
I don't think there is a simple way to solve this issue: the best would
probably to not use this pointer the way you are using it as it was not
designed to work this way.
I'm sure you could handle your stuff in a different manner.
tks,
Aymeric MOIZARD / ANTISIP
amsip - http://www.antisip.com
osip2 - http://www.osip.org
eXosip2 - http://savannah.nongnu.org/projects/exosip/
> Regards,
> Eugene
>
>
>
More information about the Osip
mailing list