Commit Graph

3477 Commits

Author SHA1 Message Date
Andrew Bettison
e73d50b48a Refactor "str.h": rename parameters 'dstlen' to 'dstsiz' 2015-08-17 19:43:58 +09:30
Andrew Bettison
586c6b3060 Add HTTP GET /restful/keyring/add 2015-08-10 18:13:57 +09:30
Jeremy Lakeman
c2a47c7960 Don't log cli args unless debug.verbose is set 2015-08-10 11:41:38 +09:30
Jeremy Lakeman
deb1027024 Ignore duplicate link layer packets, eg bluetooth names 2015-08-03 11:12:39 +09:30
Jeremy Lakeman
298849b25b Add buffer space for MDP MTU & headers for MDP_INTERFACE 2015-07-20 16:48:17 +09:30
Andrew Bettison
0a061e0fe8 Include "whence.h" instead of "log.h" where suitable
Some inclusions of "log.h" were simply to get struct __sourceloc and
__WHENCE__
2015-07-13 18:24:16 +09:30
Andrew Bettison
52106b5026 Move DEBUGF() from "log.h" to "debug.h"
Include "debug.h" in lots of places (not all)
New macro IDEBUGF() for indirect debug flag, used in HTTP server
2015-07-13 18:24:04 +09:30
Andrew Bettison
7d9a5faa4e Move if(config.debug.xxx) tests into DEBUGF()
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)
2015-07-13 16:00:05 +09:30
Andrew Bettison
abb2a39330 Fix MeshMS REST newsince race condition
During GET /restful/meshms/SID1/SID2/newsince/messagelist.json, if a new
message was received before the request reached the end of its message
iterator and paused, then the new message did not make it into the
output.
2015-06-29 15:39:19 +09:30
Andrew Bettison
9f15c4770c Add [httpd/N] context to HTTP server logging 2015-06-29 15:39:19 +09:30
Andrew Bettison
0ac9d15b8f Rename variable to current_httpd_request_count 2015-06-29 15:39:19 +09:30
Andrew Bettison
cf0e1aa8d6 Add log_context 2015-06-29 15:39:19 +09:30
Andrew Bettison
8d799840df Add alloca_sourceloc(), refactored from log.c 2015-06-29 15:39:19 +09:30
Andrew Bettison
819fa8bee4 No time stamps in Android log by default 2015-06-29 15:39:19 +09:30
Andrew Bettison
8ac156376d Fix MeshMS Java API when MeshMS disabled
If the MeshMS REST API is disabled, then the JSON response omits the
MeshMS status code, so the Java client API now handles this case.
2015-06-29 15:39:19 +09:30
Jeremy Lakeman
4891348684 Ensure unicode strings are correctly handled 2015-06-29 15:12:05 +09:30
Jeremy Lakeman
653039e685 Sqlite needs to be threadsafe on android 2015-06-29 09:52:08 +09:30
Jeremy Lakeman
e97f7c4e29 Fix vomp stun tests
- Don't trust stun responses about 3rd parties
- Only ack neighbour links via 1hop destinations (not multi-hop routes)
- Don't override network destinations that were manually supplied
2015-06-22 14:50:28 +09:30
Jeremy Lakeman
568f431d91 Share private addresses during stun traversal 2015-06-22 12:15:49 +09:30
Jeremy Lakeman
73c2c9e6fe Relax unreliable path tests for now 2015-06-22 12:15:49 +09:30
Jeremy Lakeman
2e618547c9 Fix ack's of seq numbers 32<x<64 old 2015-06-22 10:43:54 +09:30
Jeremy Lakeman
e9cdb67b10 MeshMS API should not fail in JSON parsing when rhizome is disabled 2015-06-15 16:13:00 +09:30
Jeremy Lakeman
9658d4527b Don't attempt to retransmit routing link information 2015-06-15 15:35:25 +09:30
Jeremy Lakeman
f76dc67c75 Fix next tick calculation for unicast destinations 2015-06-15 15:35:07 +09:30
Jeremy Lakeman
5aeb9b960d Move config to a thread local 2015-06-15 14:14:41 +09:30
Andrew Bettison
6febcc350d Replace RESTful newsince polling with triggers
Remove the 'api.restful.newsince_poll_ms' config option, no longer
needed.
2015-06-02 02:23:06 +09:30
Andrew Bettison
ed1acca0ed Fix 'rhizomerestful' and 'rhizomejava' newsince-arrival tests
Use POST /restfule/rhizome/insert REST request to add bundles instead of
CLI 'rhizome file add', to avoid database locking storm and prepare for
replacing polling with trigger-based wakeup in newsince requests.
2015-06-02 02:23:06 +09:30
Andrew Bettison
858a7fc577 Refactor: define extract_http_header() in testdefs.sh
Also http_unquote_string()
2015-06-02 02:23:06 +09:30
Andrew Bettison
45c6b9ecfa Refactor: set $CR and $HT in testdefs.sh
Fix some bugs in test scripts that used $CR without setting it
2015-06-02 02:23:06 +09:30
Andrew Bettison
51f21f3183 Fix http server pause: could stop polling too early
A paused http server should only stop polling on output once all
existing buffered output has been sent
2015-06-02 02:23:06 +09:30
Andrew Bettison
008f296026 Generic trigger functions "trigger.h" 2015-06-02 02:23:06 +09:30
Jeremy Lakeman
a3de276999 Allow SIGIO to unblock poll() without dying 2015-06-01 16:46:21 +09:30
Andrew Bettison
d5b96b9931 Fix 'meshms' and 'meshmsjava' newsince-arrival tests
Failed because of a database locking storm between the three waiting
newsince REST requests (which polled the database) and the concurrent
'meshms send' CLI commands.  Changed to use REST requests instead of CLI
for 'meshms send'.
2015-05-25 16:46:43 +09:30
Jeremy Lakeman
9c5cac6565 Add missing file 2015-05-25 16:44:51 +09:30
Jeremy Lakeman
f98f33ef82 Release mdp socket in config sync 2015-05-25 11:49:48 +09:30
Jeremy Lakeman
51ed6162dd Add support for running and stopping servald from a JVM thread
fdpoll will now run a callback when about to sleep / woke up.
A new Java interface to indicate server started / sleeping / waking up.
An android implementation may allow the CPU to sleep.
If there's a java exception the server will try to shutdown.
Calling servald stop is currently undefined.
2015-05-25 11:46:37 +09:30
Andrew Bettison
106f5d04d9 Fix 'msp' test failures: different netcat versions
The "traditional" variant of nc(1) ("netcat") (installed by default on
Debian and Ubuntu) behaves differently from the OpenBSD variant, causing
two 'msp' tests to fail.  Added -q options to nc(1) invocations to make
tests pass with either variant.
2015-05-18 17:20:01 +09:30
Andrew Bettison
f4df768041 Improve test framework: report stderr/stdout of execute within fork
So that if execute() is used within a forked process and if that process
is terminated prematurely, the log will show what the execute'd command
was doing
2015-05-18 17:17:29 +09:30
Andrew Bettison
c560374da5 Quieten some stderr ephemera in test logs 2015-05-18 17:15:18 +09:30
Jeremy Lakeman
d5e0835f21 Add explicit timeout parameter to mdp trace for slow links 2015-05-11 15:47:35 +09:30
Jeremy Lakeman
b75c926ee3 Relax ack timing 2015-05-11 15:47:35 +09:30
Andrew Bettison
30f4a398ea Merge RESTful Rhizome journal append into development
Support for appending to Rhizome journals using the RESTful API
2015-04-13 16:59:06 +09:30
Andrew Bettison
979854ae0b Test that Rhizome RESTful append rejects non-journals 2015-04-13 16:24:05 +09:30
Andrew Bettison
5120e50dd7 Suppress Rhizome add de-duplication for journals 2015-04-13 16:24:05 +09:30
Andrew Bettison
0f8141af95 Test RESTful Rhizome journal append with shared payload
When an append produces a payload that is already in the store,
the append must succeed, and the returned status codes should
indicate that the payload already existed
2015-04-13 16:24:05 +09:30
Andrew Bettison
53e4e5be5f Improve 'rhizomerestful' journal append test case
Add asserts for the returned status codes
2015-04-13 14:43:52 +09:30
Andrew Bettison
f602674ea5 RESTful Rhizome add/insert always return HTTP 201
The 200 status is reserved to indicate a well-formed and
legal request but the bundle was not added because the
store rejected it.
2015-04-13 14:39:51 +09:30
Andrew Bettison
7734e24006 /restful/rhizome/append on existing journal
Refactor Rhizome insert/append logic into functions used by both CLI and
RESTful API.  Improve RESTful diagnostic messages.
2015-03-30 18:24:12 +10:30
Andrew Bettison
214dad421b Rename 'rhizomerestful' journal test cases 2015-03-30 18:21:31 +10:30
Andrew Bettison
86c3c7312c Better support for Rhizome logging status enums
Provide functions that return non-NULL even on invalid enum
values
2015-03-30 18:19:26 +10:30