Commit Briefs

Omar Polo

change log_request to take the code and meta unpacked

don't know what i was smoking when I wrote log_request() like that...


Omar Polo

change on fatalx -> log_warnx

we already check the validity of the format string, but still avoid a gratious fatal() at runtime.



Omar Polo

avoid needless strlen()


Omar Polo

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.






Omar Polo

plug memory leak in client_close_ev


Omar Polo

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.


Omar Polo

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


Omar Polo

copyright years++


Omar Polo

remove unused global flag


Omar Polo

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