From 82387caf2fce79b2b3a78cd5ee4422ea6cff5820 Mon Sep 17 00:00:00 2001 From: Vladimir Dubrovin <3proxy@3proxy.ru> Date: Sun, 25 Oct 2026 19:59:44 +0300 Subject: [PATCH] Event loops: the callbacks' relay given back to sockmap() on a reload sockmap() has a connection go by the newest configuration's rules after a reload (reattachfunc), which may end it. The relay of the callbacks did not, and a connection the new rules refuse went on. Once the configuration is newer than the connection, it is given back to sockmap() as it is, which does. Co-Authored-By: Claude Opus 5.5 --- src/mainloop.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/mainloop.c b/src/mainloop.c index 18cef32..705d02e 100644 --- a/src/mainloop.c +++ b/src/mainloop.c @@ -410,6 +410,9 @@ static int cbmaprun(struct cbmap *m){ int round, moved = 0; ssize_t n; + /* a reload: sockmap() takes the connection back, which has it go by + the newest configuration's rules, or ends it */ + if(param->version < runconf->version) return cbmapend(m, -2); for(round = 0; round < CBROUNDS; round++){ int progress = 0, end = !m->halfclose && (m->cterm_r || m->sterm_r); @@ -532,7 +535,8 @@ static void cbmapidle(struct loop *l, struct looptimer *t){ } /* sockmapcbfunc: sockmap() of a fiber, as callbacks, its result; -2 for - sockmap() to map it itself. */ + sockmap() to map it itself, from the start or from where the callbacks + left it after a reload. */ static int fibermap(struct clientparam *param, int timeo){ struct looper *lp = curlooper; struct cbmap m;