[asterisk-dev] [Code Review] Fix for parking lot settings not being respected with unit test
Mark Michelson
mmichelson at digium.com
Tue Mar 2 23:29:44 CST 2010
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/539/#review1624
-----------------------------------------------------------
I think I might see where the refcount problem lies.
On the first go-around, where you use the defaults, everything works as it should.
On the second go-around, where you set the channel variable for PARKINGLOT, it appears that a new parkinglot is created in park_space_reserve and linked into the parkinglots container. When you call unpark_test_channel, you unref the pu->parkinglot. At this point, the container's reference is still present, and so the parkinglot is not destroyed.
On the third go-around, where you once again have the PARKINGLOT chanvar set and use masq_park_call, park_space_reserve simply finds the parkinglot that was created during the last parking operation and you get a reference to that. When you call unpark_test_channel, pu->parkinglot is unreffed.
At the end of the test, I believe that the parkinglots container still has a reference to the parkinglot, and so what needs to be done is to ao2_unlink the parkinglot at the end of test.
/trunk/main/features.c
<https://reviewboard.asterisk.org/r/539/#comment3636>
The final character of this string should be '4' since the next digit of pi is '5'. Round up! Significant figures!
- Mark
On 2010-03-02 20:47:45, Jeff Peeler wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/539/
> -----------------------------------------------------------
>
> (Updated 2010-03-02 20:47:45)
>
>
> Review request for Asterisk Developers.
>
>
> Summary
> -------
>
> This verifies a change in parking to ensure the channel variable PARKINGLOT is respected. Kind of overkill for an obvious change, but many more parking scenarios can be added later.
>
>
> This addresses bug 16592.
> https://issues.asterisk.org/view.php?id=16592
>
>
> Diffs
> -----
>
> /trunk/main/features.c 250288
>
> Diff: https://reviewboard.asterisk.org/r/539/diff
>
>
> Testing
> -------
>
> Verified proposed fix works and that all created channels are properly destroyed. It seems though that I do actually have a ref count problem with the dynamic lot used for testing, which I haven't been able to track down yet. I went ahead and posted the review so the rest of the test can be examined.
>
>
> Thanks,
>
> Jeff
>
>
More information about the asterisk-dev
mailing list