Commit Graph

1581 Commits

Author SHA1 Message Date
Andrew Bettison
f4d0b7a16a Fix some minor bugs in recent commits 2012-10-10 18:13:31 +10:30
Jeremy Lakeman
b22e3f1964 Add hop count to mdp ping
- Allow mdp client to specify ttl
- Copy ttl into and out of overlay frame
2012-10-10 16:22:31 +10:30
Jeremy Lakeman
4658251ebe Only allow abreviated SID's in route announcements 2012-10-10 15:29:36 +10:30
Jeremy Lakeman
4b2b8f1783 Store keyring identity pointer for local identities in subscriber tree 2012-10-10 15:29:36 +10:30
Andrew Bettison
2a8cfb0404 Quieten Rhizome advertisement debug logging
Introduce DEBUG_RHIZOME_ADS and sqlite_set_debugmask(), use in
rhizome_packetformats.c advertisement mustering and processing code.
2012-10-10 13:22:30 +10:30
Andrew Bettison
04d50e0057 Typedef debugflags_t replaces (unsigned int) 2012-10-10 13:21:20 +10:30
Andrew Bettison
3678522872 Issue #17, add AUTHOR column to Rhizome MANIFESTS table
Replace ".selfsigned" column with ".author" and ".fromhere" columns in
output of "rhizome list" command.  (Note that a "sender" column is
already present.)

Add 'author' field to struct rhizome_manifest.

Log all fully rendered SQL statements on DEBUG_RHIZOME.

Update 'rhizomeops' test cases and improve the assert_rhizome_list()
test function to be able to assert authorship of files.
2012-10-09 17:48:06 +10:30
Jeremy Lakeman
1de2bc8f23 Fix replying to broadcast mdp ping 2012-10-09 17:03:17 +10:30
Jeremy Lakeman
5d553538e7 Remove dead code 2012-10-09 16:20:44 +10:30
Jeremy Lakeman
1f379ea209 Add and preserve QOS bit flags in packet header 2012-10-09 16:17:07 +10:30
Jeremy Lakeman
e28deeb6d5 Move requested payload queue into frame structure 2012-10-09 15:44:37 +10:30
Jeremy Lakeman
9842e22353 Add multi-hop routing test 2012-10-09 14:49:24 +10:30
Andrew Bettison
aca4e8eda9 Fix shell 'eval' metacharacter bug in test defs 2012-10-09 14:03:59 +10:30
Andrew Bettison
3433b0fbb5 Move is_sid_broadcast() and is_sid_any() macros into serval.h
From overlay_mdp.c.  is_sid_broadcast() was defined as is_broadcast().

Also clean up the signature and implementation of is_all_matching().
2012-10-09 13:49:23 +10:30
Andrew Bettison
5a6a42f36d Improve test defs: extract_stdout_keyvalue()
The extract_stdout_keyvalue() function now accepts an optional delimiter
argument, to override its default of ':'.  This makes it useful for extracting
the output of "servald config get" commands.
2012-10-09 13:35:00 +10:30
Jeremy Lakeman
275aa49903 Change route announcement format, add please explain support 2012-10-09 12:57:11 +10:30
Jeremy Lakeman
6e45f264e9 Send both original packet source and transmitter id's in olsr payloads 2012-10-09 12:57:11 +10:30
Andrew Bettison
7ee5266998 Issue #25, fix sed(1) statement for Mac OS X
Seems that OS X sed(1) does not support the compound '{cmd;cmd}' syntax in the
same way as GNU sed(1).
2012-10-09 10:05:00 +10:30
Andrew Bettison
6954325b04 Server process no longer becomes a zombie on Android
Fixes #21.  The problem was caused when the double-fork logic used in "servald
start" was clobbered in 5103176.  This meant that the servald daemon process on
Android no longer had a PPID=1, but the PID of the long-lived
"org.servalproject" parent process which called the JNI entry point.  Killing
the servald process then caused it to become a zombie process, since the
org.servalproject does not habitually call wait(2).  That caused the "servald
stop" logic to send five SIGHUPs to the zombie without any error, making it
appear that the process was not dying.

Reinstated the double-fork logic and added a new test case to ensure that the
daemon process does not become a zombie on being killed prematurely.
2012-10-08 17:20:19 +10:30
Andrew Bettison
4ecb996909 Issue #21, INFO message on unlink a stale pidfile 2012-10-08 17:20:19 +10:30
Andrew Bettison
8483276494 Fix compiler warning on Linux gcc 4.7.1
Function defined but not used.  Commented out the function definition for the
time being.
2012-10-08 17:20:19 +10:30
Jeremy Lakeman
8b9505670d Fix handling of socket closure on OSX 2012-10-08 16:53:52 +10:30
Jeremy Lakeman
c47e99d097 Fix issue #23, regression in 'id' command 2012-10-08 14:59:58 +10:30
gardners
164e9a7b87 removed dependency on -lm log2 to make Android building easier. 2012-10-08 10:46:56 +10:30
Jeremy Lakeman
7af919b02b Merge commit 'ad3b31677540b638430eba0242457d788e8e5915'
Work on devices without sdcards
2012-10-08 09:40:43 +10:30
Andrew Bettison
6e7805d9d5 Fix two 'dnahelper' tests broken by 62f8d223ea 2012-10-06 14:42:22 +09:30
Andrew Bettison
89343c69cd Merge branch 'rhizomedirect' into 'master' 2012-10-05 17:45:30 +09:30
Andrew Bettison
b4c92a289e Fix SEGV bugs on Solaris
Revealed by 'rhizomeprotocol' tests FileTransferDelete, DirectPush and
DirectSync.
2012-10-05 15:49:36 +09:30
Andrew Bettison
063fe6d467 Fix compile warning on Solaris 2012-10-05 15:09:10 +09:30
gardners
d685953ff5 Fixed storage of signatures with manifests in a codepath that
was missed in commit 1c72778c50.
2012-10-05 05:53:11 +02:00
Jeremy Lakeman
48c9a7067e keyring_get_nm_bytes doesn't need to know about port numbers 2012-10-05 09:14:24 +09:30
Romain Vimont (®om)
ad3b316775 Do not try to open rhizome database if rhizome is disabled 2012-10-04 12:34:49 +02:00
Andrew Bettison
d470ac730b Cosmetic improvement for better self-documentation 2012-10-04 18:11:16 +09:30
Andrew Bettison
2e7d19a3f7 Issue #9, fix rhizome direct push and sync tests
The "rhizome direct push" command (and also sync) was not waiting for the
server's HTTP response, so it was exiting before the server had finished
storing the bundle, which led to a race with the subsequent "assert
bundle_received_by" test.  Fixed by adding the missing code to receive the HTTP
response.

Refactored the code used for parsing HTTP responses in rhizome_fetch.c, and
used it in rhizome_direct_http.c.
2012-10-04 17:38:33 +09:30
Andrew Bettison
3ce57c8955 Fix SQL prepare retry code missed by 3040d2b665 2012-10-04 16:21:08 +09:30
Andrew Bettison
9614d4f89c Issue #9, a little bit of refactoring 2012-10-04 14:35:09 +09:30
Andrew Bettison
3040d2b665 Add Rhizome DB retries on SQL statement preparation
It turns out that if the DB is locked, sqlite_prepare_v2() call can return
SQLITE_BUSY.  The retry logic (implemented for issue #2) only provided for
sqlite_step() to return SQLITE_BUSY.  It was a fairly straightforward matter to
extend the retry logic to cover statement preparation in an equally general
fashion.

The problem was observed while diagnosing failures in the rhizomeprotocol
DirectPush test case: the "servald rhizome list" command was failing due to a
locked database.  See issue #9.
2012-10-04 14:30:20 +09:30
Andrew Bettison
e1cacdb687 Issue #9, improve 'rhizomeprotocol' tests
Rename Push, Pull, Sync to DirectPush, DirectPull, DirectSync.

Move HttpAdd test to just after HttpImport test.

Tighten up the assertions in Rhizome Direct test cases.

Factor the "assert_rhizome_list" test out of assert_received() to avoid having
to water down assert_rhizome_list(), which currently takes an exact list of all
files that must be present in the list, and is more valuable that way.
2012-10-04 14:25:08 +09:30
Andrew Bettison
f18d7ba9af Re-instate .selfsigned check in assert_rhizome_list()
Also add checks for the "version", "date" and ".inserttime" columns, that they
match the corresponding manifest or are at least well formed.

Issue #9.
2012-10-04 14:22:06 +09:30
Andrew Bettison
37d4b4fa3a Issue #9, fixed a compiler warning and bug
The warning was that 'fd' could be used uninitialised in rhizome_store_file(),
and it was true!
2012-10-04 11:42:13 +09:30
Andrew Bettison
f527ae9425 Improve dump() debugging function
Now dump() accepts any type of pointer to the data.

Also tidied up some other debugging macro definitions to reduce duplication of
code.
2012-10-04 11:40:40 +09:30
gardners
90fd7e3fd8 fixed bug where <1KB manifests would get found in 0-1K and 1K-2K
buckets.  Also removed some debugging. #9
2012-10-03 18:22:48 +02:00
gardners
8aa18db913 ... and same fix for sync case, and that passes now as well.
All rhizomeprotocol tests now PASS with merged changes. #9
2012-10-03 18:17:12 +02:00
gardners
ab61ee698e switched rhizome direct push/pull/sync target from instance A to B
and made corresponding adjustments.  Oddly push and pull work again.
Maybe there is some subtle bug in the test framework?
Anyway, now to fix the sync test. #9
2012-10-03 18:15:09 +02:00
gardners
99f8e9b86d progress on tracking down post-merge bugs that are stopping
rhizome direct push/pull/sync tests from working. #9
2012-10-03 17:55:55 +02:00
gardners
295f7c68ec some rhizome schema cleanups, including importantly making filesize
an integer not text column, so that FILESIZE BETWEEN clauses behave
numerically rather than lexographically.  Added an index for good
measure. #9
2012-10-03 17:54:39 +02:00
gardners
661f369296 Reintroduce fix for returning full buffer of responses to rhizome
direct sync enquiry request.  Still something else broken
post-merge, but we are getting closer. #9
2012-10-03 16:51:08 +02:00
gardners
33107e795f Reduced debug output. #9 2012-10-03 16:26:41 +02:00
gardners
4e0c0064ba added rhizome.api.addfile.author config option to supply author SID
as hex if not supplying a manifest template.
modified rhizomeprotocol test of manifest-less HTTP import to set
that option.  That test now passes.
ALL rhizomeprotocol tests now pass. #9
2012-10-03 16:24:06 +02:00
gardners
2e907e6fff fixed some bugs with rhizomeprotocol tests and manifest-less
file import. It now rungs in rhizomeprotocol test suite, but fails
because the BK= field is missing (but the file is imported).
Also removed the assertions about receiving bundles from the push
test as it was non-deterministic.  The bundle reception is already
tested, so there is no loss.
Investigating missing BK=.
Also test 8 (sync) fails post-merge, although push and pull work
intepdendently. Will investigate that post-merge. #9
2012-10-03 16:23:27 +02:00