ccrtp-devel
[Top][All Lists]
Advanced

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

[Ccrtp-devel] membership control hash table


From: Vassil Ilinski
Subject: [Ccrtp-devel] membership control hash table
Date: Wed, 21 Aug 2002 03:38:07 -0700 (PDT)

hello! 

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

__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com




reply via email to

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