commit 735336b21edbca50b1650df091ed2dad47f96c27 from: Omar Polo date: Mon Jul 19 11:15:44 2021 UTC unbreak configless mode An un-initialized field in the configless code path leads to a crash on the first request. commit - abc8801d6064304c627cd75ed1f8c585d51346de commit + 735336b21edbca50b1650df091ed2dad47f96c27 blob - c7fce524ba82043a458ac7efcb151a2d2c18885c blob + 90149890802e3c54711b35f965563cbffa8ea53e --- ChangeLog +++ ChangeLog @@ -1,3 +1,7 @@ +2021-07-19 Omar Polo + + * gmid.c (setup_configless): unbreak configless mode + 2021-07-13 Anna “CyberTailor” * parse.y (yyerror): error and warning messages are prefixed with "error:" and "warning:" 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"`