Skip to content

Commit

Permalink
Fix iteration of to be sent MSILO messages
Browse files Browse the repository at this point in the history
Fixes issue #291
Thanks to Nick Altmann for reporting & testing
  • Loading branch information
vladpaiu committed Aug 14, 2014
1 parent 795d5cb commit 1dd4ea2
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion modules/msilo/ms_msg_list.c
Expand Up @@ -251,7 +251,7 @@ int msg_list_set_flag(msg_list ml, int mid, int fl)
*/
int msg_list_check(msg_list ml)
{
msg_list_el p0;
msg_list_el p0,p1;

if(!ml)
goto errorx;
Expand All @@ -278,6 +278,8 @@ int msg_list_check(msg_list ml)
if(!ml->nrsent)
ml->lsent = NULL;

p1 = p0->next;

if(ml->ldone)
(ml->ldone)->prev = p0;
p0->next = ml->ldone;
Expand All @@ -286,6 +288,13 @@ int msg_list_check(msg_list ml)

ml->ldone = p0;
ml->nrdone++;

if (!p1)
break;
else {
p0 = p1;
continue;
}
}
p0 = p0->next;
}
Expand Down

0 comments on commit 1dd4ea2

Please sign in to comment.