Commit Briefs
move imsgev & co to their own file
This avoids bringing the dependency on ev on telescope-identity(1) and the tests as well.
fix handling of gopher selectors
Much of telescope works in terms of URI, so we convert each gopher link to an URI. However, we didn't urlencode the path parameter, thus failing on every link that contains spaces or similar invalid (in URI paths) characters. Issue reported by hryjksn on github, thanks! https://github.com/omar-polo/telescope/issues/14
convert telescope to use ev instead of libevent
libevent is a very cool library, I like the APIs and enjoy using it. However, telescope is not as large and doesn't have as many file descriptor, so libevent is quite ``too big'' for our needs. ev started as a small event loop on top of poll(2) for amused, and can be used here too, it just needed to grow the ability to handle several timers, as we need quite some on telescope (in fact, we use more timers than fds!)
add client_cert_temp flag to the struct tab
This way we can improve unload-certificate prompt. While here, move the cert handling in make_request().
move tofu declarations to their own header
While here replace GEMINI_URL_LEN with TOFU_URL_MAX_LEN to avoid a dependency on telescope.h. Ideally, we should move this stuff to another header that comes with less dependencies.
some headers cleanup
try to not include headers from headers, and remove some redundant include. This helps in modularizing the codebase and also helps during incremental compilations.
load and optionally remember client certificates
This adds use-certificate, a user function to start using a certificate or switch to a different one. It asks whether to persist the certificate, if not it will only be used for the current session. use-certificate is implicitly called when the server replies with a 6x status code.
first draft of client certificate support
At the moment telescope loads a mapping host:port/path -> certificate from a file and always uses it, no ways to change it, use a temporary one, generate a new one, etc are provided yet. The format of ~/.telescope/certs/certs is host port path certificate file name where the certificate file name is the name of a file inside ~/.telescope/certs. ~/.telescope/certs/ is ~/.local/share/telescope/ when using XDG.
remove imsg_borrow_str
it's redundant due to ibuf_borrow_str()