From c62761e4c6edc763ef26827c31100edb87d8d37f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Luk=C3=A1=C5=A1=20Ondr=C3=A1=C4=8Dek?= Date: Thu, 9 Jan 2025 00:13:16 +0100 Subject: [PATCH] daemon/defer: fix infinite UDP reclassification after TCP request --- daemon/defer.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/daemon/defer.c b/daemon/defer.c index 0e45a2520..bdd96b5e6 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 -- 2.47.2