Commit Graph

3418 Commits

Author SHA1 Message Date
Andrew Bettison
a060642fdb Add strbuf_local_buf() macro 2015-11-02 10:11:41 +10:30
Andrew Bettison
27d98a29fa Reimplement strlcpy() using strncpy_nul() 2015-11-02 10:11:41 +10:30
Andrew Bettison
3ab7e04497 Add buf_strncpy_nul(), use in place of strlcpy() 2015-11-02 10:11:41 +10:30
Andrew Bettison
90e02141d1 Reimplement WHY() macro without comma operator
GCC 4.9 and later warn about unused values produced by the comma
operator.  Since the -Wno-unused-value option was removed from the
non-Android Makefile.in, it will not compile the WHY() macro and its
variants, with the -Wall option.

This commit removes the comma operator from the WHY() macro and its
variants, and replaces it with a new inline wrapper function.

This commit also removes the WHYNULL() macro and fixes the three places
it was used.
2015-10-26 15:58:52 +10:30
Jeremy Lakeman
0c275e67ef Clean up compilation warnings 2015-10-19 13:45:57 +10:30
Jeremy Lakeman
3049252c8a Poll netlink socket for interface changes on linux systems 2015-10-12 18:11:44 +10:30
Andrew Bettison
e770998372 Fix empty-string tests on char[]
Caused compiler errors, thanks to Jonas Höchst for reporting.
2015-10-01 07:05:17 +09:30
Andrew Bettison
404cc1476d Improve HTTP Origin header parsing
Parses the separate parts of the URI: scheme, hostname, port.
No longer supports "Origin: null", because that is not in the
spec.
2015-10-01 07:05:17 +09:30
Andrew Bettison
367d54f5f8 Add functions to parse uint16_t 2015-10-01 07:05:17 +09:30
Andrew Bettison
f73cd77185 Change arg of ctype functions from char to int
Consistent with functions defined in <ctype>; now all can be used
as a predicate function with the type int (*)(int).
2015-10-01 07:05:17 +09:30
Jeremy Lakeman
2fdd23e864 Do not add name and number to seeded keyring entry 2015-09-28 12:04:13 +09:30
Jeremy Lakeman
41d416977f Deprecate java command line api to keyring commands 2015-09-28 12:03:39 +09:30
Jeremy Lakeman
75df3bd4ec Format network addresses using posix API 2015-09-28 11:58:48 +09:30
Jeremy Lakeman
79e8a94792 Add route_link.h 2015-09-28 11:58:48 +09:30
Andrew Bettison
a276fc9d28 Remove Rhizome enabled test from Keyring REST API 2015-09-28 09:56:15 +09:30
Andrew Bettison
6123503c15 Improve Rhizome HTTP status codes
Also improve some reason phrases and test them
2015-09-21 18:43:24 +09:30
Andrew Bettison
96055e6b6c Fix test failure in HTTP POST /rhizome/import
Introduced in edc8aba
2015-09-21 18:43:24 +09:30
Andrew Bettison
3c18b7a3d9 Add missing header dependencies to Makefile 2015-09-21 12:45:03 +09:30
Andrew Bettison
487fe462b2 Add "extern" to some array decls in str.h 2015-09-21 12:30:36 +09:30
Andrew Bettison
7635e6b71b Add Keyring Java API (incomplete) with tests
keyringListIdentities()
keyringSetDidName()
2015-08-31 19:16:30 +09:30
Andrew Bettison
0e783c6b73 Fix malformed HTTP output of JSON fields 2015-08-31 19:16:30 +09:30
Andrew Bettison
714ea63190 Change JSON response of GET HTTP /restful/keyring/...
Return "sid", "did" and "name" fields inside their own "identity"
object
2015-08-31 19:16:30 +09:30
Andrew Bettison
e956749727 Move utility functions from 'rhizomejava' test to testdefs_java.sh 2015-08-31 19:16:30 +09:30
Andrew Bettison
6486b3f469 Improve test defs create_identities()
Only set $DIDA1, $NAMEA1, etc. vars if the identity has a DID or
Name field
2015-08-31 19:16:30 +09:30
Andrew Bettison
71c7a4f870 strbuf_json_atom() supports JSON objects and arrays 2015-08-31 19:16:30 +09:30
gardners
edc8aba100 remove hard-wired references to "data" and replace with PART_PAYLOAD 2015-08-31 15:31:58 +09:30
gardners
a93c711952 honour instance path for http rhizome/import function. 2015-08-31 15:13:35 +09:30
Andrew Bettison
85a15cb01f Merge branch 'keyring-restful' into 'development' 2015-08-24 23:16:10 +09:30
Andrew Bettison
8ba612ffa1 HTTP GET /restful/keyring/set[?pin=PIN][&did=DID][&name=Name] 2015-08-24 22:54:45 +09:30
Andrew Bettison
8834a81575 Refactor HTTP GET /restful/keyring/add 2015-08-24 22:44:24 +09:30
Andrew Bettison
380a72113c pin= query param for HTTP GET /restful/keyring/identities.json 2015-08-24 22:41:53 +09:30
Andrew Bettison
564f8973af Improve test defs: create_identities() with PINs 2015-08-24 22:41:53 +09:30
Andrew Bettison
b7ba297e31 Add TODO comments to randomise keyring slot allocation 2015-08-24 22:41:53 +09:30
Andrew Bettison
166a03c7c6 Remove useless safety checks 2015-08-24 22:41:53 +09:30
Andrew Bettison
73ced0f93a pin= query param for HTTP GET /restful/keyring/add 2015-08-24 22:41:53 +09:30
Andrew Bettison
ce7a6ba988 HTTP server: parse query parameters 2015-08-24 22:41:53 +09:30
Jeremy Lakeman
00a2ea2913 Ignore potential race condition between setting up instance path and first log message 2015-08-24 16:38:55 +09:30
gardners
52bd428c09 make rhizome http port number configurable via serval.conf 2015-08-24 16:06:25 +09:30
Jeremy Lakeman
84caf21969 Use section linking to define httpd pages 2015-08-24 12:49:09 +09:30
gardners
dab244d92f shorten section names (and precursors) to keep in the 16 char limit
of the O-MACH assembler on OSX.
2015-08-24 10:17:04 +09:30
Andrew Bettison
0a40d9849c Add uri and www-form-uri encode/decode functions 2015-08-17 19:46:50 +09:30
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