-
Notifications
You must be signed in to change notification settings - Fork 851
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix CSNode array overflow issue #724
Conversation
|
there is no SndUList::insert() in whole srtcore code before. Only SndUList::update() will be used.
because SndUList::insert() will use the same lock. the lock may be not reentry |
I saw that inserting is called somewhere in the sending function (in core.cpp). I still don't get what exactly problem this PR solves. |
Could you please show me the code ? I can not find it in master branch: [root@ srtcore]# grep -r 'insert(' core.cpp |
Ok, it was something else. Looxlike "update" is the only function used for it, and "insert" is not in use at all. I must research it myself first. |
|
Ok, now I understand what's going on here. Your change is perfectly ok, but I'd improve it with a small refactoring:
This will at least avoid the unnecessary unlock-lock cycle. |
If a node has not been insert into CSNode array before, when update() is called, we need to call insert() to check whether the CSNode array is full or not.