Write test case assertions using jq(1) utility, increase from four
bundles to 100.
Fix bugs in HTTP server content generation logic.
Make payload content generator read payload 4KiB at a time, to
always read on filesystem block boundaries for performance. Increase
size of payload in relevant test case.
Content generator functions now take arguments describing the buffer
they are to fill, and respond with a struct containing the number of
bytes filled, and the number of free bytes needed before being called
again.
The HTTP response logic now fills the buffer as much as possible before
calling write(2) by topping it up instead of waiting for it to be
completely emptied before generating more content.
Support generated content with an unspecified Content-Length. Generator
functions return 1 if there is more content to come, and 0 if they have
just produced the last piece of content.
The C standard defines the difference between two (char*) pointers is
defined to be either short, int or long. Not long long (64 bits). On
64-bit systems, logging "%"PRIhttp_size_t (int64_t) for pointer
difference works by coincidence because a long or int is 64 bits, but
causes SEGV on 32 bit platforms.
The portable solution is to log pointer differences using "%d" and
explicitly cast the pointer difference to (int) in the arg list, or
"%ld" and cast it to (long).
So that "http_server.h" does not have to include "serval.h" which
creates a circular dependency.
Remove the __SERVALDNA__HTTP_SERVER_IMPLEMENTATION hack from
"http_server.h"