From: Štěpán Balážik Date: Wed, 6 Jan 2021 12:06:25 +0000 (+0100) Subject: daemon/worker.c: fix warning from compilation without asserts X-Git-Tag: v5.3.0~27^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=059dcfbe10a2c95d38153b83eed72fd1274da944;p=thirdparty%2Fknot-resolver.git daemon/worker.c: fix warning from compilation without asserts 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. --- diff --git a/daemon/worker.c b/daemon/worker.c index 8c7684dff..7bf9a7543 100644 --- a/daemon/worker.c +++ b/daemon/worker.c @@ -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); } }