Event loops: a fiber's stack given back while its client is relayed

A child for which mapping is the last thing it does (tcppm, tlspr) sets
maptail, what it does once mapping is over as its own end would: its
log line, prepared before for tlspr. Relayed by the loop, the client's
fiber then gives up its stack at once: left in the middle of the
child's code, never to be resumed, it is started over from the start of
its stack for the next client (fiberreset), or freed where it cannot be
(Windows). Once mapping is over the loop ends the client as the child
and its fiber would: the result, the tail, the connection released and
freed. After a reload, which sockmap() is to see to, the client is
given a fiber again for sockmap() to go on with the mapping, then its
end. Not while a reload is pending: sockmap() sees to it on the fiber.

The callbacks' state is no longer on the fiber's stack but allocated.

clientparam has maptail and maptaildata: plugins are to be built again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Vladimir DubrovinandClaude Opus 5.5 committed 2026-10-25 23:25:33 +03:00
1 parent be1ae65c4f
commit 973fc89d58
7 files changed
+179 -44

No files matched your search

+6
View File
@@ -937,6 +937,12 @@ struct clientparam {
password[USERNAMELEN],
extusername[USERNAMELEN],
extpassword[USERNAMELEN];
/* Set by a child for which mapping is the last thing it does: what it
does once mapping returns, as its own end would, given its result in
res, for a loop to end it so with no fiber of its own meanwhile.
maptaildata is malloc()'d or NULL, freed with the connection. */
void (*maptail)(struct clientparam *param, void *data);
void *maptaildata;
/* The filters this connection runs, which a new connection makes for
itself: the service's are not copied to it. Ordered for each stage. */
struct filterp filters[MAX_FILTERS],