Commits


simplify request handling get rid of check_path(), it's overly complicated. Instead, inline open_file() in client_read() and rework open_dir() to just use openat() instead of the complicate dance it was doing. Simplify open_dir() too in the process: if the directory entry for the index is not a regular file, pretend it doesn't exist.


use a function-local buffer for the canonical redirect


use snprintf() instead of chain of strlcpy/cat


call getnameinfo() only once per request


avoid gratious strlen; evbuffer_readln returns the length


plug memory leak in client_close_ev


fix client_close_ev when tls_close() returns TLS_WANT_POLLIN/OUT in those cases we need to reschedule the function and return, instead of going on with the cleanup.


properly handle handshake failures If a TLS handshake fails there's nothing we can do, so don't attempt to reply an error (the connected client is not speaking Gemini as it's not using TLS at all) and instead just close the connection. Fixes issue #13


copyright years++


remove unused global flag


don't match host if connecting from the wrong socket limit how one given virtual host can be reached based on its `listen on' lists


load the certs per listening address


send host addresses to the server process


implement `listen on' Listening by default on all the addresses is so bad I don't know why I haven't changed this before. Anyway. Add a `listen on $hostname port $port' syntax to the config file and deprecate the old "port" and "ipv6" global setting. Still try to honour them when no "listen on" directive is used for backward compatibily, but this will go away in the next next version hopefully. At the moment the `listen on' in server context don't filter the host, i.e. one can still reach a host from a address not specified in the corresponding `liste on', this will be added later.


rename client->addr to raddr (remote address) and keep original length