[asterisk-dev] oej: trunk r128242 - /trunk/channels/chan_sip.c
Johansson Olle E
oej at edvina.net
Sun Jul 6 03:02:21 CDT 2008
6 jul 2008 kl. 06.16 skrev Russell Bryant:
>
> On Jul 5, 2008, at 4:59 PM, SVN commits to the Digium repositories
> wrote:
>
>> Author: oej
>> Date: Sat Jul 5 15:59:49 2008
>> New Revision: 128242
>>
>> URL: http://svn.digium.com/view/asterisk?view=rev&rev=128242
>> Log:
>> KILL THE USER!
>>
>> Actually, kill the in-memory structure for type=user and start using
>> the sip_peer
>> structure for every object. Have only one in-memory list and use
>> them different
>> ways depending on type=user, type=peer and type=friend - like always.
>>
>> The idea with this first patch is that configurations should work as
>> before.
>>
>> Some additional features for realtime peers. By adding a type=
>> field, you
>> can now have multiple functions.
>>
>> Let's test this for a while. Won't be integrated in 1.6.0, only in
>> trunk,
>> for testing.
>>
>> There's propably more to clean up and simplify here. Help is welcome
>> and encouraged!
>
> First comment; please update sip.conf.sample to reflect these changes.
There are no changes to sip.conf.sample - the syntax is the same.
Or did you want something else in there?
>
>
>> @@ -11931,10 +11649,15 @@
>> int debug=sip_debug_test_addr(sin);
>> struct sip_peer *peer;
>>
>> - /* For subscribes, match on peer name only; for other methods,
>> + /* For subscribes, match on device name only; for other methods,
>> * match on IP address-port of the incoming request.
>> */
>> - peer = (sipmethod == SIP_SUBSCRIBE) ? find_peer(of, NULL, 1) :
>> find_peer(NULL, &p->recv, 1);
>> + /* First find device on name */
>> + peer = find_peer(of, NULL, TRUE, FALSE);
>> +
>> + /* Then find device on IP (if it's not a SUBSCRIBE) */
>> + if (sipmethod != SIP_SUBSCRIBE)
>> + find_peer(NULL, &p->recv, TRUE, FALSE);
>
> There is a bug here. I'm not sure what the intent is, but this second
> call to find_peer is clearly leaking a reference.
Please help me with that, since I don't see the same. I'm not fully
up to date with all the object changes in trunk, so I would be happy
to learn from your or someone else's fix to this problem.
/Olle
More information about the asterisk-dev
mailing list