The OpenJDK 7 recently introduced the UNUSED() macro in their jni_md.h
header file, which is included from <jni.h>. This causes a
compile-error if "constants.h", which defines our own UNUSED() macro, is
included as well as <jni.h>.
The OpenJDK UNUSED() macro is unsuitable for our own use, because it
prefixes the unused identifier with "UNUSED_" whereas we depend on the
parameter name remaining unchanged.
I have reported this as a Request for Enhancement with Oracle Java,
asking them to remove the UNUSED() macro, since it is not used by any
JNI or Java extension header files. Review ID: JI-9013689.
In the meantime, constants.h now undefines UNUSED before defining it, so
including <jni.h> before "constants.h" will avoid a compile error.
Include local (my) and remote (their) SIDs in JSON responses for
conversationlist.json and messagelist.json, so that the same JSON
structures can be used in future for non-SID-specific queries.
Refactor MeshMS message iterator, rename "sender" and "recipient" fields
to "my" and "their", for consistency with the rest of the MeshMS source
code, and because "sender" and "recipient" are properties that apply to
a single message or single ply, not to a message thread (conversation).
Change HTTP request buffer pointers from (const char*) to (char*)
because some Rhizome operations can modify received data in-place, eg,
when decrypting it.
Refactor a lot of Rhizome bundle storage code to use the new "enum
rhizome_payload_status" instead of mysterious int values to represent
the outcome of the operation.
Instead of int64_t. Fixes some -Wsign-compare warnings.
Replace sqlite_exec_int64() with sqlite_exec_uint64().
Also store rowid as uint64_t, and use 0 not -1 to indicate
unset.
This may have been a reversion to older code caused by a careless
merge, because the change to RHIZOME_SIZE_UNSET was already made
when read_state.length was changed to unsigned.
Fixes some -Wsign-compare warnings
Now tokens are included in each row instead of a single token in the
enclosing JSON object. Only puts tokens on the first row, and
thereafter all rows with a rowid higher than for the previous row that
had a token.
New ".rowid" output field from rhizome add, import, extract, export
operations. (Also added missing ".inserttime" and "date" fields to
some operations.)
Use new "rhizome add file" .rowid output field to check output of of
/restful/rhizome/bundlelist.json
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.
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"