]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
daemon/worker nitpick: revert stats.dropped accounting
authorVladimír Čunát <vladimir.cunat@nic.cz>
Thu, 4 Oct 2018 09:55:59 +0000 (11:55 +0200)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Fri, 12 Oct 2018 15:36:46 +0000 (17:36 +0200)
Only count incoming requests into this,
as before "some simplifications" commit.

daemon/worker.c

index 0b44820bd8814744b29f48011df24b7e88566d8c..da74ea520666f7294c1a79fd3902b58b387c7272 100644 (file)
@@ -1416,12 +1416,13 @@ int worker_submit(struct session *session, knot_pkt_t *query)
        /* Parse packet */
        int ret = parse_packet(query);
 
-       bool is_query = (knot_wire_get_qr(query->wire) == 0);
+       const bool is_query = (knot_wire_get_qr(query->wire) == 0);
+       const bool is_outgoing = session_flags(session)->outgoing;
        /* Ignore badly formed queries. */
        if (!query ||
            (ret != kr_ok() && ret != kr_error(EMSGSIZE)) ||
-           (is_query == session_flags(session)->outgoing)) {
-               if (query) worker->stats.dropped += 1;
+           (is_query == is_outgoing)) {
+               if (query && !is_outgoing) worker->stats.dropped += 1;
                return kr_error(EILSEQ);
        }
 
@@ -1429,7 +1430,7 @@ int worker_submit(struct session *session, knot_pkt_t *query)
         * or resume if this is subrequest */
        struct qr_task *task = NULL;
        struct sockaddr *addr = NULL;
-       if (!session_flags(session)->outgoing) { /* request from a client */
+       if (!is_outgoing) { /* request from a client */
                struct request_ctx *ctx = request_create(worker, handle,
                                                         session_get_peer(session));
                if (!ctx) {