mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Fixed bug when adjusting queue size
This commit is contained in:
parent
9b2d3e50b2
commit
88a131a2e8
|
@ -603,10 +603,11 @@ int rtp_release_session_recv ( RTPSession *session )
|
|||
*/
|
||||
void rtp_queue_adjust_limit(RTPSession *session, uint64_t limit)
|
||||
{
|
||||
RTPMessage *_tmp, * _it;
|
||||
pthread_mutex_lock(&session->mutex);
|
||||
|
||||
RTPMessage *_tmp, * _it = session->oldest_msg;
|
||||
|
||||
for ( _it = session->oldest_msg; session->queue_size > limit; _it = _tmp ) {
|
||||
for ( ; session->queue_size > limit; _it = _tmp ) {
|
||||
_tmp = _it->next;
|
||||
rtp_free_msg( session, _it);
|
||||
session->queue_size --;
|
||||
|
|
Loading…
Reference in New Issue
Block a user