From e0a05f343f4e64c4f711a56d1bdbc7dd1076f3c2 Mon Sep 17 00:00:00 2001 From: Vladimir Dubrovin <3proxy@3proxy.ru> Date: Tue, 27 Oct 2026 00:03:23 +0300 Subject: [PATCH] connlim: a connection's slot given back once releaseparam() gave the connection limits' slot back without clearing param->connlim: a second call, made on the event loops' end of a relayed client, gave it back again, letting one more connection in for each such end while another held its slot, or, with no connlimconf, followed param->srv, cleared by the first call. It is cleared now. A UDP session taken over by the new service on a reload gave its slot back but kept connlim set, so the new service's authorization did not count it, and its end gave it back a second time. It is counted again. Co-Authored-By: Claude Opus 5.5 --- src/mainclient.c | 2 ++ src/mainudp.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/mainclient.c b/src/mainclient.c index 17e40d1..9b67ea4 100644 --- a/src/mainclient.c +++ b/src/mainclient.c @@ -451,7 +451,9 @@ void releaseparam(struct clientparam * param) { if(param->filters[param->nfilters].filter->filter_clear) (*param->filters[param->nfilters].filter->filter_clear)(param->filters[param->nfilters].data); } + /* once: a second release must not give the slot back again */ if(param->connlim) stopconnlims(param); + param->connlim = 0; /* a slot held in the newest service on the listener after a reload */ if(param->newsrv){ slotrelease(param->newsrv); diff --git a/src/mainudp.c b/src/mainudp.c index 5e65b63..3b13cc1 100644 --- a/src/mainudp.c +++ b/src/mainudp.c @@ -440,7 +440,9 @@ static void udpadopt(struct udpstate *st){ if(param->filters[param->nfilters].filter->filter_clear) (*param->filters[param->nfilters].filter->filter_clear)(param->filters[param->nfilters].data); } + /* counted again by the new service's authorization */ if(param->connlim) stopconnlims(param); + param->connlim = 0; param->bandlimfunc = NULL; param->bandlims[0] = param->bandlimsout[0] = NULL; param->trafcountfunc = NULL;