Files
freeswitch/tests/unit
Andrey Volk 815bbf8cfa [Core] Stop partner uuid lookups from growing the session pool, with a unit-test (#3311)
switch_channel_get_partner_uuid_copy() read signal_bond and originate_signal_bond with dup set, so every call
copied the uuid into the session pool before copying it into the caller's buffer. The read path calls it for
each comfort-noise frame of a bridged leg, so the pool grew by 40 bytes per frame until hangup. The lookups now
return the channel's own value, which stays valid under profile_mutex while it is copied.

The copy used strncpy(), which leaves the buffer without a terminating NUL when the value is as long as the
buffer or longer. switch_copy_string() cuts the value to fit and always terminates it.

With RTCP passthru, every received RTCP packet looked the partner up with switch_channel_get_partner_uuid(), which
copies the uuid into the session pool, so the pool grew with each packet until hangup. The lookup now copies the
uuid into a stack buffer with switch_channel_get_partner_uuid_copy().
2026-11-26 15:50:36 +03:00
..
2026-08-08 17:48:05 +03:00
2019-11-21 22:06:14 +04:00
2026-05-26 22:02:42 +03:00
2024-12-03 21:30:46 +01:00
2024-10-11 20:16:39 +02:00
2024-12-03 21:30:46 +01:00
2026-08-08 19:47:47 +03:00
2026-08-08 18:29:25 +03:00
2021-04-27 13:54:32 -06:00
2026-08-08 21:02:15 +03:00
2026-08-08 17:48:05 +03:00
2026-05-26 22:02:42 +03:00
2024-12-03 21:30:46 +01:00

FreeSWITCH unit tests should be kept as shallow unit tests and micro
benchmarks testing functionality exposed through libfreeswitch.

Requirements for a new unit tests: 

1. Tests must use switch_test.h framework