"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Stefan Sperling <stsp@stsp.name>
Subject:
gotwebd hang fix
To:
gameoftrees@openbsd.org
Date:
Thu, 13 Nov 2025 14:29:23 +0100

Download raw body.

Thread
  • Stefan Sperling:

    gotwebd hang fix

Stop reading from gotwebd client in sockets.c once request has been parsed.

Fixes an issue seen during regression tests I am writing where w3m would
sometimes get stuck requesting a page from gotwebd, making the test hang.

M  gotwebd/sockets.c  |  3+  1-

1 file changed, 3 insertions(+), 1 deletion(-)

commit - e1302e4cbaf5d028ab78608039863bc2764c2f44
commit + 3cc5de1da361133af2a6eb3ff277a03ef0bb39b7
blob - dfc566af8883931fd6ceecd7f3777d10e0b39bef
blob + f70495430f50e31b79ea07f70a6d4ee6f1447c05
--- gotwebd/sockets.c
+++ gotwebd/sockets.c
@@ -557,6 +557,7 @@ process_request(struct request *c)
 	}
 
 	c->fd = -1;
+	event_del(&c->ev);
 	c->client_status = CLIENT_REQUEST;
 	env->worker_load[c->worker_idx]++;
 	return 0;
@@ -1169,7 +1170,8 @@ read_fcgi_records(int fd, short events, void *arg)
 		memmove(c->buf, c->buf + record_len, c->buf_len);
 	}
 more:
-	event_add(&c->ev, NULL);
+	if (c->client_status < CLIENT_REQUEST)
+		event_add(&c->ev, NULL);
 	return;
 fail:
 	request_done(c);