Commit Graph

3418 Commits

Author SHA1 Message Date
Jeremy Lakeman
d0ae11d419 Flush stdout on android 2014-09-12 15:24:23 +09:30
Andrew Bettison
e05d70b1a5 Fix wild assertion in HTTP server
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.
2014-09-11 16:11:23 +09:30
Andrew Bettison
2aa3b85440 Fix un/signed comparison warning (error) 2014-09-11 16:10:49 +09:30
Tobias Wooldridge
866631c525 Fixes compile fatal error with section(command) on OS X, ifdef'd so fix doesn't break Ubuntu. Licensed under the BSD license. All rights/copyright granted to Serval Project Inc. 2014-09-08 14:17:03 +09:30
Jeremy Lakeman
6aa6aa69eb Immediately register unlocked identities 2014-09-08 11:25:35 +09:30
Jeremy Lakeman
83949f6585 Never call at_exit functions from android dalvik vm 2014-09-08 11:24:19 +09:30
Jeremy Lakeman
097f72f04f Respond to directory publish requests with success / failure 2014-09-01 12:05:08 +09:30
Jeremy Lakeman
97e7de03cd Fix include order 2014-09-01 11:55:50 +09:30
Jeremy Lakeman
a37db8e958 Move most console commands to other files 2014-08-25 16:03:30 +09:30
Jeremy Lakeman
9896b6680a Display git version when running within a submodule 2014-08-25 13:51:30 +09:30
Jeremy Lakeman
23f2401d46 Sort commands when displaying usage 2014-08-25 13:35:27 +09:30
Jeremy Lakeman
22a81ad7ed Add missing header file 2014-08-25 13:30:36 +09:30
Jeremy Lakeman
2ec63b371a Build the array of console commands by using linkage tricks 2014-08-22 10:36:52 +09:30
Andrew Bettison
7e1fbe8c76 Refactor to fix some OS-X compile warnings
Fixes two minor bugs that escaped notice until now
2014-08-14 17:39:44 +09:30
Andrew Bettison
ccece93309 Refactor "conf_schema.h" to fix compile warnings
In STRUCT() and ARRAY() declarations, change the optional "validator"
arg from taking a bare function name to enclose the function name in
VALIDATOR(function)
2014-08-14 16:40:30 +09:30
Jeremy Lakeman
d2015a44b9 Fix documentation of monitor state for vomp calls 2014-08-04 17:04:11 +09:30
Jeremy Lakeman
31cf3a67b5 Allow lcal http servers to perform cross site scripting of restful APIs 2014-07-28 12:54:57 +09:30
Andrew Bettison
d436705e64 Fix conflict on UNUSED() macro from OpenJDK 7
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.
2014-07-23 11:55:55 +09:30
Jeremy Lakeman
5a38d2eb0c Add message timestamp to Java API 2014-07-21 16:13:17 +09:30
Jeremy Lakeman
6c08c8d4a4 Fix cast from Object to primitive types 2014-07-18 14:21:34 +09:30
Jeremy Lakeman
435ffecfa8 Add message timestamps to restful meshms 2014-07-18 14:11:57 +09:30
Jeremy Lakeman
69ffe6a56c Fix meshmsjava tests with additional timestamps 2014-07-14 16:21:12 +09:30
Jeremy Lakeman
4aac9e768e Fix clang error due to copy paste 2014-07-14 16:01:10 +09:30
Jeremy Lakeman
d275a34802 Don't just straight to LIST_END when there's an end time in the future 2014-07-14 15:28:30 +09:30
Jeremy Lakeman
eaf069e1c3 Dont treat database lock errors the same as missing records 2014-07-14 15:26:50 +09:30
Jeremy Lakeman
bc87f8c7c0 Add timestamps to meshms messages and acks 2014-07-14 13:43:37 +09:30
Andrew Bettison
89623015fc MeshMS Java API: list messages new since token 2014-07-14 06:06:21 +09:30
Andrew Bettison
4c6612a61e Rhizome Java API: list bundles new since token 2014-07-12 22:49:00 +09:30
Andrew Bettison
606f087dd5 Merge latest Rhizome Java API into development 2014-07-11 12:29:24 +09:30
Andrew Bettison
2757a08b87 Rhizome Java API: insert inconsistent bundle 2014-07-11 11:15:08 +09:30
Andrew Bettison
8842f32b19 Rhizome Java API: insert journal is not implemented
Change the HTTP response code for unimplemented operations from 403 to
501
2014-07-10 22:23:11 +09:30
Andrew Bettison
e35bf77938 Rhizome Java API: insert/update empty bundle 2014-07-10 22:06:46 +09:30
Andrew Bettison
a87133d4d3 Rhizome Java API: insert anonymous bundle 2014-07-10 21:19:15 +09:30
Andrew Bettison
04b2a20e54 Rhizome Java API: improved form-data headers
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
2014-07-10 21:12:40 +09:30
Andrew Bettison
07dfc42f8f Fixes #42 - VoMP session ID allocation 2014-07-10 13:04:56 +09:30
Andrew Bettison
e2d8ca1e66 Issue #11: remove unnecessary long long 2014-07-10 12:42:32 +09:30
Andrew Bettison
57cce64b6c Rhizome Java API: narrower exceptions 2014-07-10 06:43:24 +09:30
Andrew Bettison
a81d05b4f6 Rhizome Java API: insert bundle 2014-07-10 06:43:17 +09:30
Andrew Bettison
3715c5bf0b Rhizome Java API: negative fetch tests 2014-07-10 06:30:50 +09:30
Andrew Bettison
2aec8f31a4 Rhizome Java API: get decrypted payload 2014-07-10 06:30:50 +09:30
Andrew Bettison
d16be8f42d Improve MeshMS HTTP RESTful interface
Provide "meshms_status_message" in returned JSON status content
2014-07-10 06:30:50 +09:30
Andrew Bettison
cf43635789 Improve Rhizome HTTP 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
2014-07-10 06:29:51 +09:30
Andrew Bettison
34b6ff48bf Rhizome Java API: get raw payload
Added more "Serval-Rhizome-Bundle-xxx" headers to /restful/rhizome/
responses, so that a more complete manifest can be constructed from
them
2014-07-10 06:29:09 +09:30
Andrew Bettison
93e67ede63 Rhizome Java API: get manifest
Fixes assertion violation in GET /restful/rhizome/<BID>.rhm when <BID>
not found
2014-07-10 06:29:09 +09:30
Andrew Bettison
db8ee79a4e Rhizome Java API: list bundles 2014-07-10 06:29:09 +09:30
Andrew Bettison
61023287b1 Refactor Rhizome manifest validation
New function returns text describing the failed validation
2014-07-10 06:29:09 +09:30
Andrew Bettison
1ac67de0e9 Fix bug in HTTP server's form-data parsing
Did not handle a non-empty preamble properly
2014-07-10 06:29:09 +09:30
Jeremy Lakeman
51540a3017 Implement read and write pointer using memcpy, might fix #78 2014-07-07 16:28:20 +09:30
Jeremy Lakeman
20d6bdf317 Add Java API getter for servald binary path 2014-07-07 15:08:21 +09:30
Jeremy Lakeman
63226143ac Don't log an error when MDP fetch fails due to missing bundle 2014-07-07 11:31:09 +09:30