summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2012-11-21 18:33:16 +0000
committerRichard Mudgett <rmudgett@digium.com>2012-11-21 18:33:16 +0000
commit4ccf2c7aa5e8be4a7f38170c3e7a3d1fa5beed9c (patch)
tree3cd809184b0d4490e359f6f23a32a8071f092880 /channels
parentcc01a794631bcd794ff84dd31f466562c9464f3e (diff)
Add red-black tree container type to astobj2.
* Add red-black tree container type. * Add CLI command "astobj2 container dump <name>" * Added ao2_container_dump() so the container could be dumped by other modules for debugging purposes. * Changed ao2_container_stats() so it can be used by other modules like ao2_container_check() for debugging purposes. * Updated the unit tests to check red-black tree containers. (closes issue ASTERISK-19970) Reported by: rmudgett Tested by: rmudgett Review: https://reviewboard.asterisk.org/r/2110/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@376575 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_iax2.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c
index 758b2bca2..7a2528fc3 100644
--- a/channels/chan_iax2.c
+++ b/channels/chan_iax2.c
@@ -2774,6 +2774,10 @@ static int replace_callno(const void *obj)
static int callno_hash(const void *obj, const int flags)
{
+ /*
+ * XXX A hash function should always return the same value for
+ * the same inputs.
+ */
return abs(ast_random());
}
@@ -2781,6 +2785,15 @@ static int create_callno_pools(void)
{
uint16_t i;
+ /*!
+ * \todo XXX A different method of randomly picking an available
+ * IAX2 callno needs to be devised.
+ *
+ * A hash function should always return the same value for the
+ * same inputs. This game with the hash function prevents
+ * astob2.c from generically checking the integrity of hash
+ * containers while the system runs.
+ */
if (!(callno_pool = ao2_container_alloc(CALLNO_POOL_BUCKETS, callno_hash, NULL))) {
return -1;
}