session_close(session);
break;
}
- session_waitinglist_pop(session, true);
+ // Let's be a bit defensive and check that nothing's changed before _pop()
+ // and recover if it has, as qr_task_send() is rather complex.
+ // TODO: fully analyze why the waitinglist could get empty here.
+ if (session_waitinglist_get(session) == t) {
+ session_waitinglist_pop(session, true);
+ } else { // a normal assertion could kr_error_log() too much in some rarer cases
+ VERBOSE_MSG(NULL, "soft assertion: waitinglist mismatch in send_waiting()\n");
+ }
}
return ret;
}