From: Grigorii Demidov Date: Mon, 17 Sep 2018 09:11:48 +0000 (+0200) Subject: daemon: fix clang errors X-Git-Tag: v3.1.0~10^2~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e6abd28ece689e91a6d18d1f02e1d83ea561554e;p=thirdparty%2Fknot-resolver.git daemon: fix clang errors --- diff --git a/daemon/io.c b/daemon/io.c index d6a9df409..0615b9452 100644 --- a/daemon/io.c +++ b/daemon/io.c @@ -49,17 +49,6 @@ static void check_bufsize(uv_handle_t* handle) #undef negotiate_bufsize -static uv_stream_t *handle_borrow(uv_loop_t *loop) -{ - struct worker_ctx *worker = loop->data; - void *req = worker_iohandle_borrow(worker); - if (!req) { - return NULL; - } - - return (uv_stream_t *)req; -} - static void handle_getbuf(uv_handle_t* handle, size_t suggested_size, uv_buf_t* buf) { /* UDP sessions use worker buffer for wire data, diff --git a/daemon/tls.c b/daemon/tls.c index 4f88edb61..fa2e894b5 100644 --- a/daemon/tls.c +++ b/daemon/tls.c @@ -458,8 +458,6 @@ ssize_t tls_process_input_data(struct session *s, const uint8_t *buf, ssize_t nr /* See https://gnutls.org/manual/html_node/Data-transfer-and-termination.html#Data-transfer-and-termination */ ssize_t submitted = 0; - bool is_retrying = false; - uint64_t retrying_start = 0; uint8_t *wire_buf = session_wirebuf_get_free_start(s); size_t wire_buf_size = session_wirebuf_get_free_size(s); while (true) { diff --git a/daemon/worker.c b/daemon/worker.c index 115054072..5cea9e6d0 100644 --- a/daemon/worker.c +++ b/daemon/worker.c @@ -623,36 +623,6 @@ static void qr_task_free(struct qr_task *task) worker->stats.concurrent -= 1; } -/*@ Register new qr_task within session. */ -static int qr_task_register(struct qr_task *task, struct session *session) -{ - assert(session_is_outgoing(session) == false && - session_get_handle(session)->type == UV_TCP); - - int ret = session_tasklist_add(session, task); - if (ret < 0) { - return kr_error(ENOMEM); - } - - struct request_ctx *ctx = task->ctx; - assert(ctx && (ctx->source.session == NULL || ctx->source.session == session)); - ctx->source.session = session; - /* Soft-limit on parallel queries, there is no "slow down" RCODE - * that we could use to signalize to client, but we can stop reading, - * an in effect shrink TCP window size. To get more precise throttling, - * we would need to copy remainder of the unread buffer and reassemble - * when resuming reading. This is NYI. */ - if (session_tasklist_get_len(session) >= task->ctx->worker->tcp_pipeline_max) { - uv_handle_t *handle = session_get_handle(session); - if (handle && !session_is_throttled(session) && !session_is_closing(session)) { - io_stop_read(handle); - session_set_throttled(session, true); - } - } - - return 0; -} - static void qr_task_complete(struct qr_task *task) { struct request_ctx *ctx = task->ctx; @@ -1744,12 +1714,6 @@ static struct session* worker_find_tcp_waiting(struct worker_ctx *worker, return map_find_tcp_session(&worker->tcp_waiting, addr); } -/* Return DNS/TCP message size. */ -static int get_msg_size(const uint8_t *msg) -{ - return wire_read_u16(msg); -} - int worker_end_tcp(struct session *session) { if (!session) {