]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
daemon/worker: fixed missing return value check
authorMarek Vavruša <mvavrusa@cloudflare.com>
Thu, 18 Jan 2018 00:57:00 +0000 (16:57 -0800)
committerMarek Vavruša <mvavrusa@cloudflare.com>
Thu, 18 Jan 2018 04:05:28 +0000 (20:05 -0800)
daemon/worker.c

index 0b3ea89fd3877450e65c6c6eaf075bb6cc9cb127..9a86fe76422081cb531575eb1f3d5f1e0a4568ad 100644 (file)
@@ -936,7 +936,7 @@ static int qr_task_send(struct qr_task *task, uv_handle_t *handle, struct sockad
                ret = kr_resolve_checkout(req, NULL, addr,
                                          handle->type == UV_UDP ? SOCK_DGRAM : SOCK_STREAM,
                                          pkt);
-               if (ret != kr_ok()) {
+               if (ret != 0) {
                        iorequest_release(worker, ioreq);
                        return ret;
                }
@@ -2162,6 +2162,9 @@ int worker_process_tcp(struct worker_ctx *worker, uv_stream_t *handle,
                if (ret == 0) {
                        const struct sockaddr *addr = session->outgoing ? &session->peer.ip : NULL;
                        ret = qr_task_step(task, addr, pkt_buf);
+                       if (ret != 0) {
+                               return ret;
+                       }
                }
                if (len > 0) {
                        /* TODO: this is simple via iteration; recursion doesn't really help */