Commit Briefs

Omar Polo

don't crash if -n is given without -c

If -n is given without -c, config_path is still NULL and it would crash due to a NULL deference.


Omar Polo

unbreak configless mode

An un-initialized field in the configless code path leads to a crash on the first request.


Omar Polo

move parse_portno to gmid.c

it's used only to parse the -p flag. While there add check_port_num to check the range for the port.


Omar Polo

style(9)-ify


Omar Polo

initialize the logger early

Initialize the logger as soon as possible and log by default to stderr. With this, some (common?) errors are printed early instead of ending up in syslog. # NB: this is in configless mode % ./gmid -p 80 [2021-07-07 11:05:57] bind: Address already in use % ./gmid -p 81 [2021-07-07 11:13:53] bind: Permission denied %


Omar Polo

gracefully shut down fastcgi backends

we need to delete the events associated with the backends, otherwise the server process won't ever quit. Here, we add a pending counter to every backend and shut down immediately if they aren't handling any client; otherwise we try to close them as soon as possible (i.e. when they close the connection to the last connected client.)


Omar Polo

reset fcgi array in free_config

otherwise path, port and/or prog could become an invalid pointer.




Omar Polo

define GMID_STRING and reuse-it

GMID_VERSION follows the CGI/FastCGI style, i.e. project_name/version. Define GMID_STRING with a more "human" variant "project_name version", and reuse that in the --help and --version codepath.


Omar Polo

add version in usage


Omar Polo

use getprogname() in usage()



Omar Polo

allow sending fd to log on to the logger process

the logger process now can receive a file descriptor to write logs to. At the moment the logic is simple, if it receives a file it logs there, otherwise it logs to syslog. This will allow to log on custom log files.


Omar Polo

free fastcgi param list