tls_read() and tls_write() may return TLS_WANT_POLLIN or TLS_WANT_POLLOUT
if data isn't ready to be read or written yet. We have to account for this
by converting it to EAGAIN, which is how a typical read() or write()
function should behave.
Also installed a SIGPIPE handler; we do not want to be terminated by
SIGPIPE, and it's safe to ignore this signal because it should be
handled thoroughly in the code.
These functions previously operated on the assumption that fgetc() would
block; however it will not block on HttpServer streams because those are
non-blocking. They now check error conditions properly before failing
prematurely.
You might be asking why I would just write a simple curl replacement
when curl does the job just fine. Well, the most immediate reason is
to test the HttpClient API, but since Telodendria's goal is to not
be dependent on any third-party code if at all possible, it makes
sense to have a simple HTTP client to use not only for testing
Telodendria, but also for configuring it. When we move the
configuration to the database, we'll ship a script that uses this
tool to allow admins to easily submit API requests.
Do not be concerned that HttpClient does not support TLS yet. TLS
support is necessary for federation to work, so it is coming
eventually.
This is helpful as we're porting to different operating systems. I guess
it just makes the porting effort more satisfying. Seeing this header
makes me happy:
Server: Telodendria/0.2.0-Haiku
This allows users to turn off static compilation if the compiler or linker
throws a fit about it. Looking at you, Glibc. And PCC doesn't seem to like
static compilation either; it generates a binary that just segfaults
immediately on executation.
If we're not writing out to a terminal, then echo each file out as it is
being compiled. Otherwise, if we are on a terminal, overwrite the previous
line.
It was such a pain to update the links in site/index.html for v0.1.0, so
this is necessary to prevent me from going insane manually updating all
these version numbers sprinkled everywhere.
Now web users can just click on the references and be taken to that page.
Unfortunately this generates a lot of broken links as well, for example
all the times I like to a system manual page that I don't copy to the
web server.