]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
daemon/worker.c: fix warning from compilation without asserts
authorŠtěpán Balážik <stepan.balazik@nic.cz>
Wed, 6 Jan 2021 12:06:25 +0000 (13:06 +0100)
committerTomas Krizek <tomas.krizek@nic.cz>
Wed, 6 Jan 2021 14:24:28 +0000 (15:24 +0100)
I kept the changes (especially the one in qr_task_on_send) as local as
possible while hopefully preserving the invariants other functions in
worker rely upon.

daemon/worker.c

index 8c7684dff0323b538cad73bd16b8113185d81706..7bf9a7543ab55c6433c15e8e48257e3212aefad8 100644 (file)
@@ -595,7 +595,7 @@ int qr_task_on_send(struct qr_task *task, const uv_handle_t *handle, int status)
                // start the timer
                struct kr_query *qry = array_tail(task->ctx->req.rplan.pending);
                assert(qry != NULL);
-
+               (void)qry;
                size_t timeout = task->transport->timeout;
                int ret = session_timer_start(s, on_udp_timeout, timeout, 0);
                /* Start next step with timeout, fatal if can't start a timer. */
@@ -1641,13 +1641,12 @@ static int qr_task_step(struct qr_task *task,
        {
        case KR_TRANSPORT_UDP:
                return udp_task_step(task, packet_source, packet);
-               break;
        case KR_TRANSPORT_TCP: // fall through
        case KR_TRANSPORT_TLS:
                return tcp_task_step(task, packet_source, packet);
        default:
                assert(0);
-               break;
+               return kr_error(EINVAL);
        }
 }