The in-memory identity creation test was failing intermittently because
the server only creates the in-memory identity on the first tick, and
under load the server sometimes does not tick for a while, leading to a
race with the "servald id self" command.
The test case now waits for the server to emit a tick before running the
"id self" command. This necessitated a new DEBUG() statement and a new
debug flag 'overlaytick'.
Also disabled Rhizome for all the keyring tests, as unnecessary Rhizome
DB creation was slowing down the fixtures.
The quit-on-monitor-client-disconnect test was non-deterministic
depending on load (eg, other concurrently running tests). Under load,
it was likely that the server did not process the "monitor quit" command
before checking for disconnect, so the server did not terminate.
The fix was to make the monitor interface read and process all queued
input from the client before checking for HUP or ERR condition on the
socket. With this fix, the "sleep 1" kludges before and after the echo
"monitor quit" to the console command are no longer needed.
In the process the monitor interface code was modernised: eg, now it
calls read_nonblock() instead of read(2).
On OS-X (BSD), nc6 appears to be the only available variant of
netcat that matches the Linux version.
Introduces a guard function to catch invocations of nc6 when
setup_netcat6 has not been called in the fixture. Introduce
guard functions to prevent invocations of nc and netcat.
Use GNU grep, sed and awk instead of BSD variants. Developers will have
to install these using a package manager like homebrew. Updated the
INSTALL.md and doc/Development.md tech docs with instructions.
Add RHIZOME_BUNDLE_STATUS_MANIFEST_TOO_BIG enum option to indicate
that the manifest exceeded 8 KiB in size.
Refactor rhizome_add_manifest() and rhizome_manifest_finalise()
to return 'struct rhizome_bundle_result' instead of 'enum
rhizome_bundle_status', so that that their detailed failure messages
can reach the HTTP API layer instead of just being logged.
Fix HTTP response status codes produced Rhizome direct HTTP requests
to be consistent with the Rhizome RESTful API.
- Introduce the new 'struct rhizome_bundle_result' that contains a
rhizome_bundle_status enum value and an optional, nul-terminated
string that provides an explanation of the cause of the status; add
functions to construct, query, and free the struct
- Replace 'enum rhizome_add_result' with 'struct rhizome_bundle_result',
removing an unnecessary level of enum interpretation
- Make rhizome_fill_manifest() return 'struct rhizome_bundle_result' and
add logic to check that the supplied author SID is correct (previous
behaviour was: if an incorrect author SID was supplied but the correct
author could be found in the keyring, then the incorrect one was
silently ignored)
- Simplify the response code in rhizome_restful.cc to take advantage of
the new 'struct rhizome_bundle_result'; in particular, the mapping
from 'enum rhizome_bundle_status' codes to HTTP status codes is now
expressed in a single switch statement
- Fix some minor failures in test scripts revealed by the changes
List all the HTTP status codes in the REST API tech doc.
Only use 403 Forbidden for requests originating from a disallowed
origin (ie, not localhost).
- Return 400 for missing, unknown, duplicate and out-of-order form
parts in POST requests.
- Return 415 Unsupported Media Type for unsupported form part
Content-Disposition and Content-Type (including unsupported
charset).
- Return 414 Request-URI Too Long for any buffer exhaustion while
parsing request.
- Return 419 Authentication Timeout for missing crypto secret.