diff options
author | Lukáš Ondráček <lukas.ondracek@nic.cz> | 2025-01-09 00:13:16 +0100 |
---|---|---|
committer | Lukáš Ondráček <lukas.ondracek@nic.cz> | 2025-01-09 00:13:16 +0100 |
commit | c62761e4c6edc763ef26827c31100edb87d8d37f (patch) | |
tree | bdffea2895b0e4581fb457d7ed542ae2e76a5e21 | |
parent | daemon/defer: fix memory consumption limit check (diff) | |
download | knot-resolver-c62761e4c6edc763ef26827c31100edb87d8d37f.tar.xz knot-resolver-c62761e4c6edc763ef26827c31100edb87d8d37f.zip |
daemon/defer: fix infinite UDP reclassification after TCP request
-rw-r--r-- | daemon/defer.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/daemon/defer.c b/daemon/defer.c index 0e45a252..bdd96b5e 100644 --- a/daemon/defer.c +++ b/daemon/defer.c @@ -450,15 +450,15 @@ static inline void process_single_deferred(void) return; } - int priority = classify((const union kr_sockaddr *)ctx->comm->src_addr, ctx->session->stream); - if (priority > queue_ix) { // priority dropped (got higher value) - VERBOSE_LOG(" PUSH to %d\n", priority); - push_query(ctx, priority, false); - return; - } - bool eof = false; if (ctx->session->stream) { + int priority = classify((const union kr_sockaddr *)ctx->comm->src_addr, ctx->session->stream); + if (priority > queue_ix) { // priority dropped (got higher value) + VERBOSE_LOG(" PUSH to %d\n", priority); + push_query(ctx, priority, false); + return; + } + kr_assert(queue_head(sdata->queue) == ctx); queue_pop(sdata->queue); while ((queue_len(sdata->queue) > 0) && (queue_head(sdata->queue) == NULL)) { // EOF event |