mirror of https://github.com/omar-polo/gmid.git
unbreak configless mode
An un-initialized field in the configless code path leads to a crash on the first request.
This commit is contained in:
parent
8068d2ff33
commit
e65ac404d1
|
@ -1,3 +1,7 @@
|
|||
2021-07-19 Omar Polo <op@omarpolo.com>
|
||||
|
||||
* gmid.c (setup_configless): unbreak configless mode
|
||||
|
||||
2021-07-11 Omar Polo <op@omarpolo.com>
|
||||
|
||||
* configure (VERSION): 1.7.1 tagged
|
||||
|
|
1
gmid.c
1
gmid.c
|
@ -524,6 +524,7 @@ setup_configless(int argc, char **argv, const char *cgi)
|
|||
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);
|
||||
|
|
|
@ -13,10 +13,12 @@ fi
|
|||
|
||||
ggflags=
|
||||
|
||||
config_common='
|
||||
port=10965
|
||||
|
||||
config_common="
|
||||
ipv6 off
|
||||
port 10965
|
||||
'
|
||||
port $port
|
||||
"
|
||||
|
||||
# usage: config <global config> <stuff for localhost>
|
||||
# generates a configuration file reg.conf
|
||||
|
@ -101,7 +103,18 @@ 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
|
||||
|
||||
|
|
Loading…
Reference in New Issue