]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
daemon: fix rebase errors
authorGrigorii Demidov <grigorii.demidov@nic.cz>
Mon, 17 Sep 2018 08:51:25 +0000 (10:51 +0200)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Fri, 12 Oct 2018 15:36:42 +0000 (17:36 +0200)
daemon/io.c
daemon/tls.c
daemon/worker.c
daemon/worker.h

index c1c3f131dbde28afb52a29e834d1dab1ca019b0d..d6a9df409225f74b80f7d16abd1b6aa4ba2a1135 100644 (file)
@@ -263,12 +263,12 @@ static void _tcp_accept(uv_stream_t *master, int status, bool tls)
 
        /* struct session was allocated \ borrowed from memory pool. */
        struct session *session = client->data;
-       assert(session->outgoing == false);
+       assert(session_is_outgoing(session) == false);
 
        if (uv_accept(master, client) != 0) {
                /* close session, close underlying uv handles and
                 * deallocate (or return to memory pool) memory. */
-               worker_session_close(session);
+               session_close(session);
                return;
        }
 
@@ -286,7 +286,6 @@ static void _tcp_accept(uv_stream_t *master, int status, bool tls)
                return;
        }
 
-       struct worker_ctx *worker = (struct worker_ctx *)master->loop->data;
        const struct engine *engine = worker->engine;
        const struct network *net = &engine->net;
        uint64_t idle_in_timeout = net->tcp.in_idle_timeout;
@@ -430,6 +429,7 @@ int io_create(uv_loop_t *loop, uv_handle_t *handle, int type, unsigned family)
        uv_timer_t *t = session_get_timer(s);
        t->data = s;
        uv_timer_init(worker->loop, t);
+       return ret;
 }
 
 void io_deinit(uv_handle_t *handle)
index 65393a4e45b95855c57edc4c4c84703e4b780845..4f88edb6140c10926aff1de97871f05e00467833 100644 (file)
@@ -121,9 +121,9 @@ static ssize_t kres_gnutls_vec_push(gnutls_transport_ptr_t h, const giovec_t * i
                return 0;
        }
 
-       assert(t->session && t->session->handle &&
-              t->session->handle->type == UV_TCP);
-       uv_stream_t *handle = (uv_stream_t *)t->session->handle;
+       assert(t->session);
+       uv_stream_t *handle = (uv_stream_t *)session_get_handle(t->session);
+       assert(handle && handle->type == UV_TCP);
 
        /*
         * This is a little bit complicated. There are two different writes:
@@ -239,8 +239,9 @@ static int tls_handshake(struct tls_common_ctx *ctx, tls_handshake_cb handshake_
        if (err == GNUTLS_E_SUCCESS) {
                /* Handshake finished, return success */
                ctx->handshake_state = TLS_HS_DONE;
+               struct sockaddr *peer = session_get_peer(session);
                kr_log_verbose("[%s] TLS handshake with %s has completed\n",
-                              logstring,  kr_straddr(&session->peer.ip));
+                              logstring,  kr_straddr(peer));
                if (handshake_cb) {
                        handshake_cb(session, 0);
                }
@@ -259,8 +260,9 @@ static int tls_handshake(struct tls_common_ctx *ctx, tls_handshake_cb handshake_
                /* Handle warning when in verbose mode */
                const char *alert_name = gnutls_alert_get_name(gnutls_alert_get(ctx->tls_session));
                if (alert_name != NULL) {
+                       struct sockaddr *peer = session_get_peer(session);
                        kr_log_verbose("[%s] TLS alert from %s received: %s\n",
-                                      logstring, kr_straddr(&session->peer.ip), alert_name);
+                                      logstring, kr_straddr(peer), alert_name);
                }
        }
        return kr_ok();
index f7b19502ced79b8c351c366f2b29511d2d5239fd..115054072f0ace11600241f927e4bf6dc1e0240e 100644 (file)
@@ -801,8 +801,8 @@ static int qr_task_send(struct qr_task *task, uv_handle_t *handle,
 
        /* Send using given protocol */
        struct session *session = handle->data;
-       assert(session->closing == false);
-       if (session->has_tls) {
+       assert(!session_is_closing(session));
+       if (session_has_tls(session)) {
                uv_write_t *write_req = (uv_write_t *)ioreq;
                write_req->data = task;
                ret = tls_write(write_req, handle, pkt, &on_task_write);
@@ -843,7 +843,7 @@ static int qr_task_send(struct qr_task *task, uv_handle_t *handle,
        if (ctx->source.session &&
            handle != session_get_handle(ctx->source.session) &&
            addr) {
-               if (session->has_tls)
+               if (session_has_tls(session))
                        worker->stats.tls += 1;
                else if (handle->type == UV_UDP)
                        worker->stats.udp += 1;
index 8b90bf84cceabfb89f03299f919264e0fdc32d70..15f9461a44f3e8ea631fa941d2e691e9ae1d4f77 100644 (file)
@@ -78,10 +78,6 @@ void *worker_iohandle_borrow(struct worker_ctx *worker);
 
 void worker_iohandle_release(struct worker_ctx *worker, void *h);
 
-ssize_t worker_gnutls_push(gnutls_transport_ptr_t h, const void *buf, size_t len);
-
-ssize_t worker_gnutls_client_push(gnutls_transport_ptr_t h, const void *buf, size_t len);
-
 int worker_task_step(struct qr_task *task, const struct sockaddr *packet_source,
                     knot_pkt_t *packet);