43 lines
1.9 KiB
Plaintext
43 lines
1.9 KiB
Plaintext
What is it?
|
|
===========
|
|
Terrible attempt at writing a smaller replacement for cURL. Will include
|
|
a library in the future to make network operations in C convenient.
|
|
|
|
Why?
|
|
====
|
|
Because there weren't any HTTPS clients that were small, readable, and
|
|
portable with the features I needed. Also I needed to learn sockets.
|
|
|
|
Okay, but you should still use cURL in your other projects.
|
|
===========================================================
|
|
No, I shouldn't. cURL is huge, doesn't build with smaller compilers, and
|
|
has way too many features. Apportate is a cantrip, cURL is a level nine
|
|
spell.
|
|
|
|
What's apportate's featureset, anyway?
|
|
======================================
|
|
Right now, it retrieves data over HTTP or Gopher, and can support TLS,
|
|
at least when it comes to HTTPS. I'd like a more general approach to
|
|
TLS support in the future. You can build it with any implementation of
|
|
TLS so long as there's a libtls built atop it. Right now, that's Bear,
|
|
Libre, and Open at the least.
|
|
|
|
Its source code is small (< 500 lines of C total according to cloc right
|
|
now) and uses only POSIX routines -- there's no temptation to use GNU
|
|
or BSD features because I develop against musl and tcc, and I don't even
|
|
have the Linux manpages on any of my systems.
|
|
|
|
Furthermore, it has a relatively well-modularized design, at least for
|
|
my current ability. It could be much better, if I had more experience,
|
|
but it's still quite easy to add support for new protocols. For example,
|
|
adding support for Gopher took me less than five minutes, and required
|
|
no real edits to main aside from a kludge to avoid seeking for an HTTP
|
|
response header terminator.
|
|
|
|
Apportate also aims to have actually useful diagnostics; that is,
|
|
compared to other tools, apportate aims to only provide useful error
|
|
output. In the case of success, it follows the Rule of Silence; on
|
|
unrecoverable errors, it aborts immediately. It supports multiple levels
|
|
of verbosity, and exposes almost all of its internal operations for debugging.
|
|
|