Commit Graph

2634 Commits

Author SHA1 Message Date
Andrew Bettison
ab31420faf rhizome_bid_t
Consistent type for internal binary representation of Rhizome Bundle ID
(aka Manifest ID)
2013-10-03 23:16:45 +09:30
Andrew Bettison
d18e48868d Issue #69: transient text SQL binding 2013-10-03 23:16:02 +09:30
Andrew Bettison
41e18e587d Issue #69: replace sqlite3_bind_xxx() calls
Use the new sqlite_bind() and sqlite_prepare_bind() calls instead.

Add cmp_sid_t() function, use it instead of memcmp().

Use alloca_tohex_sid_t() in preference to alloca_tohex_sid() when the
argument is a sid_t.
2013-10-03 16:44:06 +09:30
Andrew Bettison
7e3a552011 Issue #69: refactor all Rhizome SQL queries to use binding
Remove all uses of sprintf(3) and its ilk to form SQL query commands.
Use the new sqlite_bind() and sqlite_prepare_bind() functions instead.
2013-10-03 15:15:30 +09:30
Andrew Bettison
41c862ea30 Fix 'rhizomeops' test case
Was broken by 919455608f
2013-10-03 15:13:28 +09:30
Andrew Bettison
8f7d600216 Issue #69: continue work on multi-bind varargs
Revise sqlite_prepare() macro et al and underlying functions to use bind
varargs instead of sprintf(3)-style varargs.

Convert all SQL function calls in rhizome_database.c
2013-10-03 01:16:10 +09:30
Andrew Bettison
772e1bf9d6 Issue #69: start writing SQLite multi-bind function 2013-10-02 18:19:20 +09:30
Andrew Bettison
06d7620314 Add "rhizome add file" --force-new option
Overrides the default behaviour of de-duplicating added manifests

New 'rhizomeops' test case: AddForceDuplicate
2013-09-30 16:48:18 +09:30
Andrew Bettison
2868cf0adf Improve Rhizome test functions
Options to allow manifest name to be given explicitly to override the
conventional "<filename>.manifest"
2013-09-30 16:39:58 +09:30
Andrew Bettison
919455608f Rename 'rhizomeops' test case
AddDuplicate -> AddDeDuplicate
2013-09-30 16:34:17 +09:30
Andrew Bettison
162108dd18 Fix duplicate payload logic
rhizome_finish_write() was treating a duplicate file hash as an error,
instead of dealing with it sensibly
2013-09-30 16:32:08 +09:30
Andrew Bettison
01216f06c2 Refactor rhizome_cleanup()
Compute time horizons once only, not once per query

Factor query that deletes orphan FILEBLOBS rows into its own function
2013-09-30 16:20:50 +09:30
Andrew Bettison
99a0d36812 Improve Rhizome debugging
Log the integer result of an int64 query
2013-09-30 16:16:44 +09:30
Andrew Bettison
c91ea7f8ac Make some Rhizome db functions static 2013-09-30 16:15:59 +09:30
Andrew Bettison
a04fc263f9 Improve comments on Rhizome db functions 2013-09-30 16:15:01 +09:30
Andrew Bettison
394870502d Fix "rhizome hash file" command for nil files
Now returns an empty result for zero-length file or zero-length file name

Test framework only invokes on non-zero-length files
2013-09-30 16:11:35 +09:30
Andrew Bettison
ae5ae2d394 Cosmetic changes to whitespace
Make it easier to edit in Vim
2013-09-30 16:06:23 +09:30
Andrew Bettison
5e164607aa Expand output of rhizome add and import
Rename 'secret:' field to '.secret:' (non-manifest-fields start with '.'
using the same convention as rhizome list)

Add '.author' and 'BK' fields to "rhizome add"

Add 'BK' field to "rhizome import"

Fix 'rhizomeops' tests to assert no 'author' and 'BK' output fields from
"rhizome add" with no author

Fiz testdefs.sh and testdefs_rhizome.sh to support new output fields
2013-09-27 22:34:22 +09:30
Andrew Bettison
ef5622f84a Fix bugs in new local socket naming code
Socket names (both file and abstract) were being truncated by two bytes
2013-09-25 16:56:06 +09:30
Andrew Bettison
c0aa4796a1 Remove MDP and Monitor socket names from config
Now they are fixed names under the instance path: "mdp.socket" and
"monitor.socket".
2013-09-25 16:56:06 +09:30
Jeremy Lakeman
ba3f77e67c Rename external payloads instead of linking and unlinking 2013-09-25 15:51:54 +09:30
Jeremy Lakeman
dab07dd4dc Remove monitor.socket & mdp.socket from tests 2013-09-24 16:27:34 +09:30
Romain Vimont (®om)
954a8a01a4 Use one MDP socket per binding instead of a single global socket. 2013-09-24 16:09:44 +09:30
Jeremy Lakeman
4838a529bd Don't busy wait while testing for MDP failover 2013-09-24 15:15:32 +09:30
Jeremy Lakeman
b38b4720cc Add html stats for http connection and mdp transfer counts 2013-09-24 14:34:51 +09:30
Jeremy Lakeman
5383b5e3be Fix signature verification cache 2013-09-24 14:34:51 +09:30
Jeremy Lakeman
9885280334 Squelch warning on success 2013-09-24 14:34:51 +09:30
Jeremy Lakeman
79bdb5f993 Add more html debugging for rhizome sync and fetch queues 2013-09-24 14:34:51 +09:30
Jeremy Lakeman
931ca60554 Refactor and simplify http server
- Define a function per page that is responsible for parsing requests
- Define a "generator" callback function for filling the buffer for a response
- Remove features that have never been used
- Remove functions that are no longer used
2013-09-24 14:34:50 +09:30
Andrew Bettison
c7eb5776f9 Fix version_string.sh script
Fix logic for appending dirty suffix to synthetic version string
(only used when no tags present, ie "git describe" fails).
2013-09-24 10:46:20 +09:30
Andrew Bettison
2e211a62d5 Fix version_string.sh: dirty suffix on untracked files
Don't use the git describe --dirty option to append the suffix
because it only considers changes in tracked files as dirt.  If
the script wants to consider untracked files as dirt then this
will not do.
2013-09-23 17:38:23 +09:30
Jeremy Lakeman
08b44e96ed Improve html debug statistics
- shift radio rssi onto interace structure
- track packets sent received
- create html output for interface stats
- create html output for link state routing stats
2013-09-23 11:31:38 +09:30
Jeremy Lakeman
ae25091fab Remove duplicate variable to ensure manifest is freed 2013-09-20 16:49:36 +09:30
Jeremy Lakeman
57577abca6 Merge branch 'mavlink' into development 2013-09-20 14:58:29 +09:30
Jeremy Lakeman
80c1da28b0 Send and track mavlink sequence number 2013-09-20 14:41:50 +09:30
Jeremy Lakeman
e3a5e8c353 Use heartbeat packets to control serial buffering
- Improve simulation of fakeradio
- Backtrack on partial RS errors in case of truncation / heartbeat insertion
2013-09-20 14:41:50 +09:30
Jeremy Lakeman
4b9817218d Improve mavlink packet synchronisation
- backtrack when decoding fails
- assume locally built heartbeats may split a valid remote packet
2013-09-20 14:41:50 +09:30
Jeremy Lakeman
f7bffbfabe Simplify packet debug logging 2013-09-20 14:41:50 +09:30
Jeremy Lakeman
2e6d3878e8 Add golay [12,24] FEC routines 2013-09-20 14:41:50 +09:30
Jeremy Lakeman
504aa92711 Send a sync immediately on importing a new bundle 2013-09-20 14:41:50 +09:30
Jeremy Lakeman
38fe34e6e5 Bump rhizome idle timeout for congested links 2013-09-20 14:41:50 +09:30
Jeremy Lakeman
926665e860 Ask for explanation of SIDs over point to point links 2013-09-20 14:41:50 +09:30
Jeremy Lakeman
d3b1ccd20e Reduce size of rhizome sync announce packets 2013-09-20 14:41:50 +09:30
Jeremy Lakeman
56d3609a3f Reduce frequency of mavlink heartbeat messages 2013-09-20 14:41:50 +09:30
Jeremy Lakeman
9f1407043a Reduce rhizome MDP debug messages 2013-09-20 14:41:49 +09:30
Jeremy Lakeman
ed21200289 Improve config description 2013-09-20 14:41:35 +09:30
Jeremy Lakeman
bc538f8bf3 Fix format for 64bit compilers 2013-09-20 14:39:44 +09:30
Andrew Bettison
4851eaf536 Issue #20: remove unique socket names from tests
The recent work on abstract local socket names means that every instance has
its own unique abstract socket name anyway, so there is no need for test
scripts to use $TFWUNIQUE in MDP and Monitor socket names to avoid
intereference when run concurrently.
2013-09-20 14:24:55 +09:30
Andrew Bettison
cc96e08e9d Issue #20: Improve socket name handling
The recently added cmp_sockaddr() function does not call stat(2) any
more to compare local AF_UNIX socket address paths, so not it is stable
enough to use for ordering sockaddr structs.

New function: real_sockaddr() converts the file path of a local AF_UNIX
file socket using realpath(3).  The MDP client uses it on the sender
address of every MDP reply packet it receives to ensure that symlinks in
the instance path do not cause MDP client failures.

Rename recently added socket_setname() function: make_local_sockaddr().
2013-09-20 14:07:19 +09:30
Andrew Bettison
17347dbe3f Issue #20: Merge branch 'daniel' into 'development'
Discard Daniel's work from 2012 in favour of the recent work on the
'development' branch which achieves the same thing in more or less the
same fashion, and was informed by the work on his branch.
2013-09-19 17:56:16 +09:30