commit e65ac404d1cd6dbc150b9f7446a88e9f886e9f32 from: Omar Polo date: Mon Jul 19 11:27:45 2021 UTC unbreak configless mode An un-initialized field in the configless code path leads to a crash on the first request. commit - 8068d2ff33992fcaf0e5f38bc7b3d86789e7e92e commit + e65ac404d1cd6dbc150b9f7446a88e9f886e9f32 blob - 56f8af2232a7d1c01577e86f0392dec57aa8b58e blob + e1a72eaa8c77c29ecb4ebe287dcd2831be437042 --- ChangeLog +++ ChangeLog @@ -1,3 +1,7 @@ +2021-07-19 Omar Polo + + * gmid.c (setup_configless): unbreak configless mode + 2021-07-11 Omar Polo * configure (VERSION): 1.7.1 tagged blob - 5d6e1ccfe673ffdfe180f6d061a6cd7ed0266fe3 blob + 01a16840b6c93039543cfa7c04460669e1aa4d9b --- gmid.c +++ gmid.c @@ -524,6 +524,7 @@ setup_configless(int argc, char **argv, const char *cg TAILQ_INSERT_HEAD(&hosts, host, vhosts); loc = xcalloc(1, sizeof(*loc)); + loc->fcgi = -1; TAILQ_INSERT_HEAD(&host->locations, loc, locations); serve(argc, argv, NULL); blob - 32ab472202f7cb3883624b687d819c8c470d0cab blob + f156d6a662e6e3d9a6d4e7722a3bd8577ef4c439 --- regress/runtime +++ regress/runtime @@ -13,10 +13,12 @@ fi ggflags= -config_common=' +port=10965 + +config_common=" ipv6 off -port 10965 -' +port $port +" # usage: config # generates a configuration file reg.conf @@ -101,8 +103,19 @@ onexit() { quit } -# tests +# configless tests +./../gmid -p $port testdata & +pid=$! +sleep 1 + +eq "$(head /)" "20 text/gemini" "Unexpected head for /" +eq "$(get /)" "# hello world$ln" "Unexpected body for /" +echo OK GET / in configless mode +quit + +# daemon tests + trap 'onexit' INT TERM EXIT endl=`printf "\r\n"`