Commit Graph

3235 Commits

Author SHA1 Message Date
Jeremy Lakeman
0cb68c98a3 Open the database immediately on config load 2014-06-23 15:31:26 +09:30
Jeremy Lakeman
7d86fcd573 Add java API wrapper for performing multiple config changes in one hit 2014-06-23 15:31:25 +09:30
Jeremy Lakeman
9f6ace518a Test that msp listen --service_name shuts down 2014-06-23 14:23:30 +09:30
Jeremy Lakeman
ca8f651b8d Cleanup the rhizome database every 30 minutes or so 2014-06-23 13:49:58 +09:30
Andrew Bettison
eba7f6555f MeshMS Java API: send message 2014-06-23 13:20:57 +09:30
Jeremy Lakeman
2ef73884a1 Add configurable limit to ensure a minimum amount of free space is preserved
- default to 100MB of free space
- currently disabled on android due to missing sys/statvfs.h
2014-06-23 13:06:21 +09:30
Andrew Bettison
819b8dc9e7 MeshMS RESTful API stricter on incoming form data
/restful/meshms/SID/SID/sendmessage now enforces Content-Disposition:
form-data (was ignoring), and enforces Content-Type: text/plain;
charset=utf-8 (was ignoring)

New negative test cases to ensure that these are treated strictly
2014-06-23 12:27:09 +09:30
Jeremy Lakeman
533c0be445 Rename mdp lookup helper function to match class name 2014-06-20 15:14:00 +09:30
Jeremy Lakeman
68dbaef38d Refactor Java API
Add stateful class to represent the state of the serval daemon, shifting some functions from BatPhone
Add convenience functions to get pre-configured MDP and HTTP Restful client classes
2014-06-20 10:55:09 +09:30
Jeremy Lakeman
47f051917d Rhizome cleanup will now expire payloads and vacuum the db file. 2014-06-19 14:23:43 +09:30
Andrew Bettison
f948f8e12e Include Java tests in 'tests/all' if Java compiler available 2014-06-19 11:38:39 +09:30
Andrew Bettison
b14c58bdf6 Merge NAF4 MeshMS Java API into development
Currently implements "list conversations" and "list messages"
2014-06-19 11:21:37 +09:30
Jeremy Lakeman
7ff89afcf4 Reinstate rhizome database storage limit
- old / large payloads should be evicted to fit more payloads
- if there isn't enough space, new payloads will not be added
2014-06-19 11:09:09 +09:30
Andrew Bettison
e9437e9a61 MeshMS Java API: list messages 2014-06-19 10:37:33 +09:30
Andrew Bettison
0a54414744 Refactor Java JSON parsing into JSONTokeniser 2014-06-19 09:55:12 +09:30
Andrew Bettison
9cbd7c365c MeshMS Java API: list conversations 2014-06-19 09:55:12 +09:30
Andrew Bettison
d879189299 Fix HTTP Authorization header parsing
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.
2014-06-19 09:55:12 +09:30
Andrew Bettison
f2772b0ce8 Refactor tests: testdefs_java.sh, testdefs_meshms.sh
meshms_add_messages() now puts message texts into TEXT[$n] array
instead of "text$n" files
2014-06-19 09:54:29 +09:30
Andrew Bettison
4fbaf8865a Improve test framework: create_file
create_file '-' sends to standard output
create_file --label=LABEL
create_file passes other options to tfw_createfile
2014-06-19 09:52:17 +09:30
Jeremy Lakeman
f4e6841ed7 Ensure directory service tests aren't creating a global routing table 2014-06-16 17:22:46 +09:30
Jeremy Lakeman
e375e17faa Fix coverage test documentation to reflect changes required to support clang 2014-06-16 16:11:11 +09:30
Jeremy Lakeman
80e139c2d9 Ensure orphan payloads or manifests are cleaned up 2014-06-16 15:56:31 +09:30
Jeremy Lakeman
f63e7fee19 Introduce typedef for handling BAR values 2014-06-16 14:38:14 +09:30
Jeremy Lakeman
dabd482ad8 Only send broadcast ticks every 5 seconds when we have no neighbours 2014-06-13 15:34:47 +09:30
Jeremy Lakeman
628a52ca87 Add monitor message for interface up/down events 2014-06-13 13:34:10 +09:30
Jeremy Lakeman
ee37385ec7 Recalculate routing table after last neighbours is lost, or interface is down 2014-06-12 17:15:29 +09:30
Jeremy Lakeman
e5e848e838 Ensure interface and routing alarms stop when network interfaces are all down 2014-06-12 16:04:15 +09:30
Andrew Bettison
55b9de721e Add assertions to http_server_poll()
This might help discover the cause of the "runaway http_server_poll"
bug sometimes observed in Batphone
2014-06-12 15:57:45 +09:30
Jeremy Lakeman
3e601aa5af Allow for an msp handler that closes another socket, dont consider a closed socket to be listening 2014-06-12 11:15:41 +09:30
Jeremy Lakeman
52da7778cd Allow closing a monitor connection to force the server to quit 2014-06-11 20:39:26 +09:30
Jeremy Lakeman
77dc7fc14c Disable and remove pthreads to support compiling with clang 2014-06-11 20:32:16 +09:30
Andrew Bettison
d46939f81e Improve server start/stop logic
Unlink server pidfile on orderly exit

Only call serverCleanUp() in server process, not in "start" command
(fixes race condition)
2014-06-11 15:18:25 +09:30
Andrew Bettison
a1c42eb378 Move serverMode flag from log.c to server.c 2014-06-11 14:53:26 +09:30
Andrew Bettison
11dcc3e972 Fix minor bugs in server start/kill tests 2014-06-11 11:15:28 +09:30
Jeremy Lakeman
afd31fe12c Ensure a race condition while starting servald only starts one process 2014-06-11 09:01:56 +09:30
Jeremy Lakeman
0b0e4cc8b4 Delay rhizome open database using an alarm, close on config change 2014-06-11 09:01:55 +09:30
Andrew Bettison
3d537f9645 Improve test framework: test coverage support 2014-06-06 14:47:54 +09:30
Andrew Bettison
13cf8b6209 Improve test framework: command-line options
Now supports -jN for --jobs=N, -fPRE for --filter=PRE, etc.
Reformatted usage message
2014-06-06 12:36:06 +09:30
Jeremy Lakeman
cb9a6731f2 Include signal.h for definition of kill() 2014-06-05 17:27:51 +09:30
Jeremy Lakeman
4435869100 Fix unused variable warning in sqlite on some platforms 2014-06-05 17:25:24 +09:30
Jeremy Lakeman
a98f7b97dc Write Java API stub to force config sync 2014-06-05 15:04:57 +09:30
Jeremy Lakeman
66f266a0c0 Fix OSX specific issues 2014-06-05 14:57:53 +09:30
Jeremy Lakeman
f09e6c38d2 Test that server quits after deleting pid file 2014-06-05 14:55:50 +09:30
Jeremy Lakeman
6d4ad0e150 Rework scheduler to allow for lazy but important alarms 2014-06-04 17:13:08 +09:30
Jeremy Lakeman
2a572d19bf Rework rhizome store to write content more lazily and cleanup more carefully 2014-06-04 17:13:08 +09:30
Jeremy Lakeman
77be2c7ef3 Fix mdp trace assert 2014-06-04 17:13:08 +09:30
Jeremy Lakeman
f93fba11af Stop polling interfaces if no phsical interfaces are enabled 2014-06-04 17:13:08 +09:30
Andrew Bettison
d811978220 Document Cooee service discovery protocol 2014-05-30 17:08:22 +09:30
Jeremy Lakeman
b6de3fcd34 Only send rhizome sync packets when we have neighbours 2014-05-30 15:03:22 +09:30
Jeremy Lakeman
0c294079af Improve reliability of routing tests 2014-05-30 14:56:31 +09:30