aboutsummaryrefslogtreecommitdiff
path: root/gmid.c
AgeCommit message (Collapse)Author
2021-03-20typoOmar Polo
2021-03-20fix signal handling so it works on linux tooOmar Polo
it seems that linux calls the signal handlers even when we're waiting on sigwait for that signal. Work around that.
2021-03-20fix correct shutdown after SIG{INT,TERM}Omar Polo
2021-03-20quit every process cleanly when receiving SIGINT or SIGTERMOmar Polo
2021-03-19refactoring: imsg everywhereOmar Polo
use imsg to handle ALL kinds of IPC in gmid. This simplifies and shorten the code, and makes everything more uniform too.
2021-03-03split usage string into two linesOmar Polo
2021-03-03give each server process its own socket for the executorOmar Polo
this fixes a bug introduced with the prefork mechanics: every server process shared the same socket, and this would cause a race condition when multiple server processes asked for a script cgi being executed. This gives each server process its own socket to talk to the executor, so the race cannot happen.
2021-02-23move log_init & vars to gmid.c, retain logger_main in log.cOmar Polo
this is to let the regression suite compile
2021-02-23moving logging to its own processOmar Polo
2021-02-12fix various compilation errorsOmar Polo
Include gmid.h as first header in every file, as it then includes config.h (that defines _GNU_SOURCE for instance). Fix also a warning about unsigned vs signed const char pointers in openssl.
2021-02-10add newline after usageOmar Polo
2021-02-08fix seccomp for the new event loopOmar Polo
add/remove syscalls from the BPF filter and move sandbox() after libevent initialisation
2021-02-07improve logs managementOmar Polo
2021-02-07added prefork optionOmar Polo
2021-02-06add the ``entrypoint'' optionOmar Polo
2021-02-06added ``block return'' and ``strip'' optionsOmar Polo
2021-02-04missing argument for LOGIOmar Polo
2021-02-04avoid race-conditionOmar Polo
what if we receive a SIGHUP right after unblock_signal (or during the whole block_signals...unblock_signals) but *before* the wait_sighup? Yeah.
2021-02-04reload configuration on SIGHUPOmar Polo
2021-02-03drop unnecessary check around closeOmar Polo
2021-02-03refactor executor_mainOmar Polo
now it's symmetrical to listener_main().
2021-02-03refactoring startup logicOmar Polo
2021-02-03drop privileges after the forkOmar Polo
2021-02-02configless: fixing the case of the implicit "."Omar Polo
I got bitten by the scope visibility rules. After the end of the block, the path variable is no longer valid, and in fact later load_vhosts fails to open that (because the buffer gets invalidated)
2021-02-01ensure absolute paths in config-less modeOmar Polo
2021-01-31set cloexec status on the socketpair fdsOmar Polo
the executor forks to spawn the cgi scripts, and they inherit the socket for communication with the listener process. Make that impossible.
2021-01-28remove unused functionOmar Polo
2021-01-27-v for verbose loggingOmar Polo
2021-01-27improve configuration parsing errorOmar Polo
2021-01-27drop unused variableOmar Polo
2021-01-27use starts_with in puny.cOmar Polo
2021-01-27make configless mode works again. also accept every hostOmar Polo
2021-01-27drop the daemon config in favour of the -f flagOmar Polo
Now it daemonize by default when running with a config, unless the -f flag is given.
2021-01-27initial punycode supportOmar Polo
2021-01-27sane defaults for the config-less modeOmar Polo
2021-01-25rework the configless mode: change flags and generate certsOmar Polo
2021-01-25chroot & drop privilegesOmar Polo
2021-01-25orderOmar Polo
2021-01-24added support for location blocksOmar Polo
2021-01-24initialize configOmar Polo
2021-01-24move configuration init stuff in its own functionOmar Polo
2021-01-21add ends_withOmar Polo
2021-01-21const-ify parameter to strtonumOmar Polo
2021-01-21use strtonumOmar Polo
2021-01-21rename mimes to mime ; pass config esplicitly to mime* functionsOmar Polo
2021-01-21don't crash on wrong vhost or missing SNIOmar Polo
the new logging code was crashing if the client didn't support SNI or if required an unknown vhost: this because we short-circuit in handle_handshake to an error, so c->iri isn't populated yet (we don't even read the request). fixes #1
2021-01-20improve logsOmar Polo
now we log the full IRI requested (before was only the path) and the response line (even for CGI).
2021-01-18improve mime handlingOmar Polo
we still have an hardcoded list, but this implements the API needed to modify the mappings.
2021-01-18removing err/warn functions with our fatalOmar Polo
err/warn is not available on some systems (unfortunately!) and in any case don't play well with our daemon mode (that closes std{in,out,err}). Use our fatal that is daemon-aware.
2021-01-17reorganize: move bunch of functions to server.cOmar Polo
cgi.c wasn't really needed; it better to group all the server related functions together, cgi or not. Now gmid.c contains only startup and utility code.