Ensure both tasklist and waitinglist is always cleared when tearing down
connection (otherwise the session close will fail on assert).
The previous assert could be triggered when the while loop in the code
above would successfuly perform qr_task_send() for one of the
tasks in waitinglist and then fail on a subsequent one.
* or write to upstream failed. */
worker_del_tcp_connected(the_worker, peer);
session_waitinglist_finalize(session, KR_STATE_FAIL);
- assert(session_tasklist_is_empty(session));
+ session_tasklist_finalize(session, KR_STATE_FAIL);
session_close(session);
} else {
session_timer_stop(session);