Commit Graph

77 Commits

Author SHA1 Message Date
Andrew Bettison
7be0d9d00d Pass author SID parameters in binary, not hex 2012-06-08 18:32:14 +09:30
Andrew Bettison
86c7819f97 Remove spurious ERROR messsages
Tests assert that stderr contains no ERROR: lines after a successful exit

Rewrote sqlite_exec_int64() to separate error outcomes from legitimate
result values

Changed several WHY() calls to DEBUG()

Improved test framework
2012-06-08 13:13:26 +09:30
Andrew Bettison
b14db5c28b Improve "rhizome add file" for empty payloads
Accept the empty string for a payload pathname to mean a zero-length
payload.
2012-06-05 15:45:53 +09:30
Andrew Bettison
a9ad1b6afc Add <bsk> optional arg to "rhizome add file"
Improve regular expressions for common data types in test scripts

Revert column count field delimiter in "rhizome list" from ":" to "\n"

Add a few more test cases
2012-06-05 13:58:59 +09:30
gardners
cdf2753412 fixed filesize display bug for "rhizome list"
(%u is 32bit on android, but filesize is 64bit)
2012-05-28 13:51:24 +02:00
Jeremy Lakeman
0f214ed46f Adjust database schema 2012-05-28 19:24:02 +09:30
Jeremy Lakeman
36389d2b78 Insert manifest within a transaction 2012-05-28 14:08:01 +09:30
Jeremy Lakeman
0e75cbdcad Document recommended sql queries 2012-05-28 09:06:07 +09:30
gardners
4da9824ab0 fixed bug in storing file that could cause entertaining file hash
problems.
2012-05-27 14:44:53 +02:00
gardners
9d811876c7 added code to make sure that we only store the original number
of bytes when storing a growing journal.  Also make sure that
hash matches.
2012-05-27 14:24:55 +02:00
gardners
30e53f963c fixed various manifest synchronisation bugs, including probably
the main one that was stopping meshms (large manifests would
practically never get advertised under certain (common) conditions).
2012-05-27 08:31:48 +02:00
gardners
58cc45043b added code to encrypt files when storing into the database. 2012-05-26 11:36:19 +02:00
gardners
2de6bb025a rhizome_extract_file can now decrypt a file, and also uses
progressive blob operations so that we can extract files of
unlimited size.
2012-05-26 11:36:19 +02:00
gardners
2cd9aca1f8 fixed bugs related to dropping files from rhizome database. 2012-05-26 11:36:19 +02:00
gardners
96b13bdadc fixed error return codes for retrieve_file() 2012-05-26 11:36:18 +02:00
gardners
596e25c16e cleanups for extracting files from rhizome. 2012-05-26 11:36:18 +02:00
gardners
c2dfefe764 fixed bug in duplicate detection 2012-05-26 11:36:18 +02:00
gardners
04cc05d6e1 refactored manifest verification into a separate function
that is called only when needed, and marks a manifest as finalised
if the verifcation fails.  reading a manifest now never sets
finalised flag, as either _finalise() or _verify() must be called.
2012-05-26 11:36:18 +02:00
gardners
8161709c4e work on fixing handling of duplicate rhizome bundle debouncing.
(seems to work from command line, but not from the test framework).
2012-05-26 11:36:18 +02:00
gardners
b0dca7e03f merged in latest changes from team. 2012-05-26 11:36:18 +02:00
Jeremy Lakeman
b358e1807e Add sender and recipient to list results 2012-05-26 13:51:07 +09:30
Andrew Bettison
d215d90b40 Refactored some rhizome db SQL code
Added sqlite_exec_void() function, so that sqlite_exec_int64() can return
an error if no rows are found instead of 0, which can be misleading.
2012-05-25 19:42:45 +09:30
Andrew Bettison
62ae488c18 Re-order "rhizome list" columns 2012-05-25 18:06:48 +09:30
Andrew Bettison
f91ed16f9b Improve "rhizome list" command
Do not join FILES, FILEMANIFESTS and MANIFESTS rows, just list MANIFEST
rows and pull all the values out of the manifest blob
2012-05-25 17:45:52 +09:30
Andrew Bettison
49aec4d331 Improve rhizome manifest debugging
Move rhizome_new_manifest() out of rhizome_read_manifest_file() so that the
out-of-manifest report shows the names of the functions where the manifests
were really allocated.
2012-05-25 15:38:13 +09:30
Andrew Bettison
c0ac693957 Remove old payload when updating a manifest with a new payload 2012-05-25 14:29:55 +09:30
Andrew Bettison
1af238a4f9 Rhizome extract commands handle missing pathnames properly 2012-05-25 11:52:49 +09:30
Andrew Bettison
fa26b53294 Fix SEGV bug
rhizome_write_manifest_file() was not checking for NULL fopen() result
Standardise rhizome "import" directory pathname handling
2012-05-24 11:28:32 +09:30
Andrew Bettison
60e4209b88 Diagnose and fix rhizome MeshMS 2012-05-23 19:01:07 +09:30
Andrew Bettison
54d456e540 Fix and reinstate FORM_RHIZOME_DATASTORE_PATH() 2012-05-23 18:11:34 +09:30
Andrew Bettison
59e58da2f4 More fixes for varargs stuff
But still no luck on Android
2012-05-23 16:07:52 +09:30
Andrew Bettison
1af9125392 All rhizome database keys are uppercase hex
FILES.id, MANIFESTS.id, FILEMANIFESTS.fileid, FILEMANIFESTS.manifestid
Named constants for hex and binary ID sizes
2012-05-23 16:04:00 +09:30
Andrew Bettison
29502d8c81 Varargs and strbuf fixes
Add missing va_end() for all va_copy()
strbuf_sprintf() adds precautionary nul to end of string after vsnprintf()
2012-05-22 14:58:05 +09:30
gardners
322806a150 force correct construction of filenames for manifests and data files
(strbuf_* not working for these right now).
2012-05-21 22:31:35 +09:30
Andrew Bettison
ce0ca8801f Implement "rhizome list" sender/recipient filtering
With tests in tests/dna_rhizome that actually revealed a bug
2012-05-21 14:42:53 +09:30
Andrew Bettison
ddd17db1c4 Make "rhizome add file" work for MeshMS 2012-05-21 00:09:14 +09:30
Andrew Bettison
345b2c1c4c Fix SEGV bug using new strbuf operations 2012-05-20 13:02:41 +09:30
Andrew Bettison
4b5e179841 Start support for MeshMS manifests 2012-05-19 14:09:50 +09:30
Andrew Bettison
5ae14ad7bc Fix bugs in rhizome_opendb()
Was calling exit() instead of returning -1 on error, which was causing
the serval app to exit in the JNI "start" command if rhizome could not
create its db file.

Use DEBUGF() instead of fprintf(stderr) in many places.

confValueGet() was not stripping \r\n off end of returned string.

rhizome_set_datastore_path() was keeping the pointer it was given (from
conValueGet()'s rotor) instead of making a strdup() copy.
2012-05-18 18:55:52 +09:30
Andrew Bettison
5e11067c72 Add 'service' column to "rhizome list" output 2012-05-17 17:00:14 +09:30
Andrew Bettison
9a51c76dfb Insist on 'service' field in all manifests
The "rhizome file add" command assumes service=file if no manifest supplied
or the manifest lacks a service field.

The "rhizome extract manifest" command includes the service in its CLI output.
2012-05-17 17:00:14 +09:30
gardners
76663d1b9e fixed sqlite handle leaks when advertising rhizome manifests. 2012-05-17 11:14:10 +09:30
Andrew Bettison
1f44fd315e Improve rhizome_find_duplicate()
Detected inconsistency does not cause failure with error message, instead a
warning is issued and the inconsistent row is skipped.
2012-05-16 16:29:41 +09:30
Andrew Bettison
6cdd5dc054 Fix and improve rhizome_find_duplicate()
Now matches version number if supplied
Performs more consistency checks, and reports failures as errors
2012-05-16 15:58:06 +09:30
gardners
bc8a028b28 increased bytes_to_hex() rotor count to allow more uses in
a single printf().
2012-05-16 15:41:41 +09:30
Andrew Bettison
33f7ea7103 Add three optional args to "rhizome list" command
service, sender_sid, recipient_sid - not yet implemented
2012-05-16 13:47:58 +09:30
gardners
8020401cf0 removed creation of keypairs table that is being deprecated in favour
of BK fields in manifest.
2012-05-15 17:26:34 +09:30
gardners
525d3c4154 substantial work towards implementing BK field in rhizome manifests. 2012-05-15 17:24:25 +09:30
Andrew Bettison
f90b21ec78 Implement rhizome config options
rhizome.datastore_path - if not set, reverts to serval instance path
rhizome.enable - if not set, defaults to true
2012-05-15 12:56:10 +09:30
Andrew Bettison
d11258cefc Overhaul debug flags
Config debug flags are now represented as individual items, eg:
   servald config set debug.verbose yes
   servald config set debug.rhizome yes
instead of aggregated, eg:
   servald config set debug verbose,rhizome  <-- no longer works

Added a debug flag "debug.all" that can be set and cleared, over which
individual flag sets/clears take priority.

Slimmed down dna.c by moving some globals and functions to the files where they
are used.

Default command line (help message) is now the new style, not the deprecated
style.
2012-05-14 18:37:32 +09:30