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

From:
Omar Polo <op@omarpolo.com>
Subject:
Re: gotwebd.conf fcgi port syntax change
To:
Stefan Sperling <stsp@stsp.name>
Cc:
gameoftrees@openbsd.org
Date:
Mon, 29 Aug 2022 15:43:46 +0200

Download raw body.

Thread
On 2022/08/29 07:08:49 +0200, Stefan Sperling <stsp@stsp.name> wrote:
> Change gotwebd.conf fcgi socket syntax to "listen on 'foo' port 'bar'".
> This prepares the grammar for multiple "listen on" statements.
> 
> The old syntax was:
> 
>   listen on 127.0.0.1
>   fgci_socket { port 9000 }
> 
> New syntax is:
> 
>   fcgi_socket yes
>   listen on 127.0.0.1 port 9000
> 
> At present, if more than once "listen on" statement is given, then only
> the last on takes effect. Fixing this will be the next step.
> 
> ok?

reads fine and fwiw i like the direction; ok for me.  I think that we
can also have `fcgi_socket yes' implicit when using `listen on
ipaddr'.

However, the patch as-is doesn't apply.

> diff f0680473a7db1e5941bffdc2ab5f80ddec209122 9dc531b939237dddb6dfb8b7e28cafe6572dae16
> commit - f0680473a7db1e5941bffdc2ab5f80ddec209122
> commit + 9dc531b939237dddb6dfb8b7e28cafe6572dae16
> blob - 601286fd54eb92e666ed42a52b7d7a851eb91940
> blob + d061ce939fdc0aeb984fb2f8da84a80463c6b189
> --- gotwebd/parse.y
> +++ gotwebd/parse.y
> [...]
> @@ -360,9 +369,6 @@ serveropts1	: REPOS_PATH STRING { | FCGI_SOCKET boolean {

this hunk is wrong.  it says that there are 9 context lines of the old
file and 6 of the new file, but they're 8 and 5 respectively, so

>  			new_srv->fcgi_socket = $2;
>  		}
> -		| FCGI_SOCKET boolean  {
> -			new_srv->fcgi_socket = $2;
> -		} '{' optnl socketopts2 '}'
>  		| UNIX_SOCKET boolean {
>  			new_srv->unix_socket = $2;
>  		}
> @@ -386,54 +392,6 @@ serveropts2	: serveropts2 serveropts1 nl

both got patch and patch(1) fails when finding a line starting with
'@' when they expect one context line still.

If i manually fix it then the patch applies

	% got patch < x
	G  gotwebd/parse.y
	@@ -360,8 +369,5 @@ applied with offset 1

fwiw my main branch points to the commit you're using as base for the
patch:

	% got ref -l refs/heads/main
	refs/heads/main: f0680473a7db1e5941bffdc2ab5f80ddec209122