ccrtp-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Ccrtp-devel] membership control hash table


From: Federico Montesino Pouzols
Subject: Re: [Ccrtp-devel] membership control hash table
Date: Wed, 21 Aug 2002 15:54:13 +0200 (CEST)

> hello!
>
   Hi,

> i have a question:
>
> in the file members.cpp, in
> MembershipControl::addNewSource(uint32 ssrc) method
> there's this piece of code that bothers me a bit:
>
> // The collision list is ordered ascendently
> RTPSource *prevpos = NULL;
> while ( pos != NULL ) {
>       if ( pos->ssrc == ssrc ) {
>               // FIX: solve collision: RAISE
>               // EXCEPTION or call plug-in
>               break;
>       } else if ( pos->ssrc > ssrc ) {
>               // insert
>               if ( prevpos )
>                       prevpos->nextcollis = newsource;
>               newsource->nextcollis = pos;
> ------>               sources[index] = newsource;
>               inserted = true;
>               break;
>       } else {
>               // keep on searching
>               prevpos = pos;
>               pos = pos->nextcollis;
>       }
> }
>
> this is the code for insertion of a new source in the
> hash table
> in the case a collision list (or at least one entry)
> at that index already exists
>
> as far as I can tell - when there's a list of sources
> with smaller SSRCs than
> the one to be inserted, all these sources are removed
> from the hash table ?
>
> isn't the intended code something like:
>               // insert
>               if ( prevpos )
>                       prevpos->nextcollis = newsource;
>               else
>                       sources[index] = newsource;
>               newsource->nextcollis = pos;
>               inserted = true;
>               break;
>
> or if I'm wrong, would you please be so kind to
> correct me
>

   You are absolutely right, this is a big bug that caused some
sources to disappear and some memory leaks to appear :). Please,
do not pay too much attention to ccRTP 0.9.1, it is highly outdated
and will be replaced with a new deeply modified version very soon.
Probably I will start to commit changes to the cvs within this week.

   Do not pay attention to the implementation nor the interface of
ccRTP, both things are going to change. If you have already
implemented something, I would suggest you to freeze that work till
the new version is out. Sorry for the inconvenience, I will set up
things so that new code will be at least in cvs as soon as possible.

   Bye!







reply via email to

[Prev in Thread] Current Thread [Next in Thread]