Original DEBUG() and DEBUGF() macros renamed to _DEBUG() and _DEBUGF()
New DEBUG() and DEBUGF() macros, first argument is flagname
New DEBUGF2(foo, bar, ...) macro does if(config.debug.foo||config.debug.bar) test
Replace almost all config.debug.xxx references to IF_DEBUG(xxx)
In the _reserve() function, an assertion compared pointers which it assumed
both pointed within the heap, or in fact within the same buffer. However, if
one pointer pointed into the stack, then the assertion would incorrectly fail
if the stack were located below the heap in address space. That never happens
in a normal Linux process, but _can_ happen in a thread, since thread stacks
may be allocated on the heap.
Solution was to re-order the steps in which _reserve() overwrites the buffer,
making the assertion irrelevant.
Change manifest Content-Type from rhizome-manifest/text to
rhizome/manifest; format="text+binarysig"
Add "Content-Transfer-Encoding" form-part headers to Java API
sent form parts, although not currently checked by Rhizome
RESTful interface
Add RHIZOME_BUNDLE_STATUS_READONLY enum value
Tighten up switch statements on bundle and payload status enums (no
default labels)
Rename some recently added enum entries
Return bundle status and payload status in HTTP responses
Add test for failing to decrypt a foreign encrypted bundle payload,
fix bug that caused an assertion failure
Add tests for fetching a non-existent manifest and fetching bundles
whose payload blob is not in the store
Was returning status 500 if Authorization: Basic token was long, because
_reserve() did not have enough free space at start of buffer. The
solution was to _commit(r) before attempting the _reserve_str() calls
for the decoded username and password.
As a separate issue, the status 500 also triggered an assertion failure
because http_request_parse_header() was returning 400 but
response.result_code had already been set to 500.
Make .o files in separate subdirectories for servald and library
Factor struct __sourceloc and __WHENCE__ from "log.h" into "whence.h"
Factor sid_t etc from "serval.h" into "serval_types.h"
Factor rhizome_bid_t etc from "rhizome.h" into "rhizome_types.h"
Do not include "serval.h" in library sources
Add log_stderr.c and logMessage.c for stand-alone executables
Change HTTP request buffer pointers from (const char*) to (char*)
because some Rhizome operations can modify received data in-place, eg,
when decrypting it.
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.