]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
daemon: do not call back when recv-end
authorMarek Vavruša <marek.vavrusa@nic.cz>
Thu, 26 Nov 2015 17:09:21 +0000 (18:09 +0100)
committerMarek Vavruša <marek.vavrusa@nic.cz>
Thu, 26 Nov 2015 17:09:21 +0000 (18:09 +0100)
daemon/io.c

index 04f2b6aec7850bdccfc31151870992a31074fe35..5000319a215cbfbb9a449d50916f44b6cf814057 100644 (file)
@@ -56,7 +56,9 @@ void udp_recv(uv_udp_t *handle, ssize_t nread, const uv_buf_t *buf,
        uv_loop_t *loop = handle->loop;
        struct worker_ctx *worker = loop->data;
        if (nread <= 0) {
-               worker_exec(worker, (uv_handle_t *)handle, NULL, addr);
+               if (nread < 0) { /* Error response, notify resolver */
+                       worker_exec(worker, (uv_handle_t *)handle, NULL, addr);
+               } /* nread == 0 is for freeing buffers, we don't need to do this */
                return;
        }