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

From:
Stefan Sperling <stsp@stsp.name>
Subject:
Re: less pipes in gotwebd
To:
Omar Polo <op@omarpolo.com>
Cc:
gameoftrees@openbsd.org
Date:
Mon, 4 Aug 2025 13:30:21 +0200

Download raw body.

Thread
On Mon, Aug 04, 2025 at 10:15:15AM +0200, Omar Polo wrote:
> updated diff below.  i'm now running with this in my instance.

> --- gotwebd/fcgi.c
> +++ gotwebd/fcgi.c
> @@ -99,6 +99,17 @@ fcgi_request(int fd, short events, void *arg)
>  	 */
>  	do {
>  		parsed = fcgi_parse_record(c->buf + c->buf_pos, c->buf_len, c);
> +
> +		/*
> +		 * When we start to actually process the entry, we
> +		 * send the request to the gotweb process, so we're
> +		 * done.
> +		 */
> +		if (c->client_status == CLIENT_DISCONNECT) {

Since it is no longer used, you could remove the CLIENT_REQUEST state
from enum client_action. Alternatively, keep using the CLIENT_REQUEST
state for this check, avoiding the wrong implication that the client will
be disconnected right here and right now, while in fact the connection will
remain open until the gotweb process is done with it.

> +			fcgi_cleanup_request(c);
> +			return;
> +		}
> +
>  		if (parsed != 0) {
>  			c->buf_pos += parsed;
>  			c->buf_len -= parsed;