Commits
- Commit:
a8a1f439210de9538b196c6bb5470c306379128c
- From:
- Omar Polo <op@omarpolo.com>
- Date:
style(9)-ify
- Commit:
8a50fc0330f50c1c0c5fc0b541e0b8a19f900ea5
- From:
- Omar Polo <op@omarpolo.com>
- Date:
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
%
- Commit:
090b8a89faa34cdc41c41e32845f1f5b444536e4
- From:
- Omar Polo <op@omarpolo.com>
- Date:
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.)
- Commit:
ef945cf4157bc8239c6da682a89ba60b11cc0e26
- From:
- Omar Polo <op@omarpolo.com>
- Date:
reset fcgi array in free_config
otherwise path, port and/or prog could become an invalid pointer.
- Commit:
f98e9045aef95fe28972d477ee549974c7cefb9f
- From:
- Omar Polo <op@omarpolo.com>
- Date:
add -D to define macros from the cmd line
- Commit:
0be2a537e6e2b336a6e46cd1f5a13663ea939ea4
- From:
- Omar Polo <op@omarpolo.com>
- Date:
sync the usage; while there also change order and capitalize
- Commit:
fdb43a4c0e347c20c0f13c3145165393c6c10883
- From:
- Omar Polo <op@omarpolo.com>
- Date:
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.
- Commit:
0233b0f6b9fcbbca701d245e82fbddca20862eeb
- From:
- Omar Polo <op@omarpolo.com>
- Date:
add version in usage
- Commit:
9327bc045a93253310a3b6933e8bd96d27298185
- From:
- Omar Polo <op@omarpolo.com>
- Date:
use getprogname() in usage()
- Commit:
5777923bb08a51b04537a127c8514186cd276a70
- From:
- Omar Polo <op@omarpolo.com>
- Date:
use getopt_long, add --help as synonym of -h and -V/--version
- Commit:
e952c5052a0c524eee6d8151b1af96ce2c94ca18
- From:
- Omar Polo <op@omarpolo.com>
- Date:
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.
- Commit:
ab1e0169b97011a56e463649044d45c5e659616c
- From:
- Omar Polo <op@omarpolo.com>
- Date:
free fastcgi param list
- Commit:
3b33eab3ad8f82f967e201ab77e16ff28cb76e8e
- From:
- Omar Polo <op@omarpolo.com>
- Date:
TAILQ_REMOVE env and aliases during config_free
it's not technically required, since a couple of lines below we free
whole host struct, and we don't have code that may use
h->{env,aliases} afterwards, but it's nice not to have invalid
pointers around. it may bite in the future.
- Commit:
8ad1c570242cd93f0802931621b49b2510b338e7
- From:
- Omar Polo <op@omarpolo.com>
- Date:
fastcgi: a first implementation
Not production-ready yet, but it's a start.
This adds a third ``backend'' for gmid: until now there it served
local files or CGI scripts, now FastCGI applications too.
FastCGI is meant to be an improvement over CGI: instead of exec'ing a
script for every request, it allows to open a single connection to an
``application'' and send the requests/receive the responses over that
socket using a simple binary protocol.
At the moment gmid supports three different methods of opening a
fastcgi connection:
- local unix sockets, with: fastcgi "/path/to/sock"
- network sockets, with: fastcgi tcp "host" [port]
port defaults to 9000 and can be either a string or a number
- subprocess, with: fastcgi spawn "/path/to/program"
the fastcgi protocol is done over the executed program stdin
of these, the last is only for testing and may be removed in the
future.
P.S.: the fastcgi rule is per-location of course :)
- Commit:
7b2d743260095ea97babde51ab6155be2fb92dbb
- From:
- Omar Polo <op@omarpolo.com>
- Date:
move pidfile & cgi to global vars