From: Tomas Krizek Date: Fri, 4 Sep 2020 10:47:54 +0000 (+0200) Subject: daemon/worker: fix connection teardown in tls_hs_cb() X-Git-Tag: v5.2.0~33^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f705d23c732c32e01721ad23568b65da44adf1b4;p=thirdparty%2Fknot-resolver.git daemon/worker: fix connection teardown in tls_hs_cb() 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. --- diff --git a/daemon/worker.c b/daemon/worker.c index e7c7fc833..41c803760 100644 --- a/daemon/worker.c +++ b/daemon/worker.c @@ -785,7 +785,7 @@ static int session_tls_hs_cb(struct session *session, int status) * 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);