aboutsummaryrefslogtreecommitdiff
path: root/server.c
AgeCommit message (Collapse)Author
2021-01-29puny_decode: set an error stringOmar Polo
2021-01-28don't log the SNI & matchingOmar Polo
I'll re-enable this when i'll improve the logging
2021-01-27log info about SNI, punycode and matched vhostOmar Polo
2021-01-27some null checksOmar Polo
2021-01-27trim_req_iri: set error stringOmar Polo
2021-01-27initial punycode supportOmar Polo
2021-01-25rework the configless mode: change flags and generate certsOmar Polo
2021-01-24added support for location blocksOmar Polo
2021-01-24added support for location blocksOmar Polo
2021-01-24void-ify some functionsOmar Polo
their return value is no longer used, it's only confusing at this point.
2021-01-24refactoring state managementOmar Polo
instead of having a flag to discern between two different behaviours in S_SENDING, split that state into S_SENDING_FILE and S_SENDING_CGI (this will also make it easier in the future to add other sending states). While there, also get rid of `goodbye' and make start_reply advance the state machine by itself.
2021-01-24added index optionOmar Polo
2021-01-23accumulate the whole response line for CGI scriptsOmar Polo
2021-01-22use a helper to handle no-body repliesOmar Polo
2021-01-22rename goodbye -> close_connOmar Polo
2021-01-21fix redirectsOmar Polo
make sure redirect starts with /. This also requires a tweak in check_path, in the case we go open_file -> send_dir -> open_file -> check-path and the path starts with a slash.
2021-01-21ensure we're in the correct stateOmar Polo
2021-01-21use fnmatch on the domain nameOmar Polo
2021-01-21simplify flow when SNI is missingOmar Polo
this also gives a chance for users to use the default host even if SNI is missing.
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-19drop useless fieldOmar Polo
was probably added to distinguish between AF_INET and AF_INET6, to use different functions for logging. But it wasn't really used, and now we use getnameinfo anyway.
2021-01-19moving "default type" from global options to server optionsOmar Polo
2021-01-19rename reason to metaOmar Polo
2021-01-19add "lang" server optionOmar Polo
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-17removing O_CLOEXECOmar Polo
we don't fork anymore in that process, so the flag is extra.
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.