]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
daemon/worker: fix connection teardown in tls_hs_cb()
authorTomas Krizek <tomas.krizek@nic.cz>
Fri, 4 Sep 2020 10:47:54 +0000 (12:47 +0200)
committerTomas Krizek <tomas.krizek@nic.cz>
Wed, 23 Sep 2020 10:08:18 +0000 (12:08 +0200)
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.

daemon/worker.c

index e7c7fc83346f9e8906d8531df45601d46fdb1f75..41c8037606bf74fe44e9891370a2fb2a5875f863 100644 (file)
@@ -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);