Daniel O'Connor
f8d5b066c0
Create #! line correctly (no need to escape !).
...
Many more tests pass now.
2012-09-07 15:42:20 +09:30
Daniel O'Connor
741ffd0d2d
Nuke debug message
2012-09-06 17:28:40 +09:30
Daniel O'Connor
7a06f55078
SHELL is not set by the shell, use BASH which is set by bash.
2012-09-06 17:19:51 +09:30
Daniel O'Connor
9f22073ab6
Detect Solaris and use GNU versions of awk, sed and grep.
...
Don't use %N as a date format unless we're on Linux.
Avoid using GNUisms with cmp & sort.
2012-09-06 16:41:24 +09:30
Daniel O'Connor
bc6681f4d7
Use $SHELL instead of hardcoding /bin/bash in the dnahelper.
2012-09-06 16:37:41 +09:30
Daniel O'Connor
d9cfc3ed48
Check we could actually build something.
2012-09-06 15:27:26 +09:30
Daniel O'Connor
03275f410f
Include stdint.h for intmax_t.
2012-09-06 15:26:40 +09:30
Daniel O'Connor
3067d74569
Use AC_CHECK_FUNCS so we automatically get HAVE_GETPEEREID.
2012-09-06 14:34:01 +09:30
Daniel O'Connor
1deb092a5f
Add OSX magic so we can use things like u_short (which is off for POSIX source which is presumably turned on by _XOPEN_SOURCE).
2012-09-06 14:32:17 +09:30
Daniel O'Connor
5f0b70cf51
Hide the LOCAL_PEERCRED/SO_PEERCRED behind #ifdef linux.
...
Note that BSD defines LOCAL_PEERCRED but its interface appears to be different to the Linux one.
2012-09-06 14:31:25 +09:30
Paul Gardner-Stephen
0562367b23
Try detecting ALSA better.
2012-09-06 12:43:06 +09:30
Paul Gardner-Stephen
2dfc056354
Add absapath function since Solaris lacks it.
...
Tests still don't work due to ancient bash though.
2012-09-06 11:55:49 +09:30
Paul Gardner-Stephen
2ccbc54dc1
Don't wander off the end of the array and trash things.
2012-09-06 11:52:32 +09:30
Paul Gardner-Stephen
3fd262c6f8
Add Solaris method for getting executable path & make the compiler
...
bail out if there is no method available rather than waiting until
runtime.
2012-09-06 07:52:22 +09:30
Paul Gardner-Stephen
0891a7429f
Use -r because Solaris' sh doesn't have -e (?!) Avoid extended REs (not necessary here but doesn't hurt)
2012-09-05 20:42:55 +09:30
Paul Gardner-Stephen
bba6839656
Initial stab at porting to Solaris.
...
It compiles without warning (with CC=gcc) but doesn't link
because NaCL doesn't build yet.
2012-09-05 20:42:50 +09:30
gardners
ed7edd3865
Added boundarystring field to rhizome_http_request structure.
...
Added call to new (currently stub) function for processing bytes
received from a HTTP POST multipart encoded form. #9
2012-09-01 14:11:23 +09:30
gardners
8170df7447
added extra field to rhizome http request structure and update
...
rhizome direct code to remember the path in a multipart form post
operation, and also the boundary string that will separate the
parts.
2012-08-31 13:15:05 +09:30
gardners
211f75cb53
Added initial parsing of POST requests, extracting content-length
...
and content-type, and complaining if they aren't in the format we
expect. #9
2012-08-31 13:01:29 +09:30
gardners
0a7c633977
swapped arg order to what seemed a more sensible order. #9
2012-08-31 13:01:29 +09:30
gardners
fb82043246
added str_str() to help parse http POST requests for rhizome direct. #9
2012-08-31 13:01:29 +09:30
gardners
389ae8e989
added skeleton HTTP request parser for rhizome direct.
...
Doesn't know how to do POST yet, which is needed for all rhizome
direct operations. #9
2012-08-31 13:01:29 +09:30
gardners
9d2aa61792
Refactoring of Rhizome http server code so that we can supply a
...
different request parser, but otherwise share code between
rhizome transfers and rhizome direct. #9
2012-08-31 13:01:28 +09:30
gardners
bde9d1c56a
Rhizome http server now allows specification of client socket callback
...
when starting, so that same server code can be shared for rhizome transfers
and rhizome direct. #9
2012-08-31 13:01:28 +09:30
gardners
2b29893a02
Initial work towards rhizome direct syncrhonisation functions #9
2012-08-31 12:58:37 +09:30
Andrew Bettison
420add0f4b
Merge branch 'master' into rhizomedirect
2012-08-30 09:38:19 +09:30
Andrew Bettison
9149c80297
Improve test framework: assert '!' command...
...
The assert command now supports leading '!' args in its command, each negating
the sense of the following command.
2012-08-30 09:33:15 +09:30
Andrew Bettison
b3f9e437b3
Issue #9 , add test case for local HTTP add
2012-08-27 17:57:41 +09:30
Andrew Bettison
41680ff663
Move functions from testdefs.sh to testdefs_rhizome.sh
...
... where they should have been in the first place.
Also, clean up the RHIZOME HTTP SERVER START log message.
Issue #9 .
2012-08-27 17:07:44 +09:30
gardners
bae2e2e4c2
Updated non-Android build process to work again (sqlite3 include path fixed,
...
also improved so that sqlite3.c doesn't need to exist as a symlink to the
real file).
2012-08-27 17:03:50 +09:30
Andrew Bettison
f93e32b4bc
Add 'rhizomeprotocol' tests for push, pull, sync
...
See issue #9 .
These commands are not yet implemented, so of course the new
tests fail.
2012-08-27 16:29:46 +09:30
Andrew Bettison
00c9c540f5
DNA helper treat poll(2) POLLNVAL like POLLERR
...
Fixes #5 , test cases failing on Mac OS X
2012-08-27 13:03:13 +09:30
Andrew Bettison
60d84817bf
Add WARNF_perror() macro
2012-08-27 13:03:13 +09:30
Daniel O'Connor
19dd10b1cc
Log the address & port of the sender of a broken Rhizome packet.
2012-08-27 12:11:06 +09:30
Daniel O'Connor
00b350aeb1
Add a note about why we aren't using SIPS/ZRTP.
2012-08-27 11:28:06 +09:30
Andrew Bettison
30e21810e4
Improve dnahelper diagnostics to investigate issue #5
2012-08-27 11:19:59 +09:30
Andrew Bettison
836a6d9b6a
Issue #5 , fix one failing test, two to go
...
On Max OS X, /bin/sh does not support echo -n option, but /bin/bash does
2012-08-24 18:40:30 +09:30
Andrew Bettison
25fbd6ffe0
Improve test framework: colours on Max OS X
...
Fixes #7 .
2012-08-24 16:30:41 +09:30
Andrew Bettison
3a6b424c2d
Fix test framework: job tracking on Mac OS X
...
Caused by difference in basic regular expressions supported by sed(1) on Mac
and on Linux: Mac does not support the \+ repeater, have to use \{1,\} instead.
2012-08-24 16:02:21 +09:30
Andrew Bettison
3f1e0dd763
Finish sleep-retry on locked Rhizome db
...
Closes #2 .
Rewrite all Rhizome db query code using new retry primitives defined in
"rhizome.h": sqlite_step_retry(), sqlite_retry(), sqlite_retry_done(), etc.
Replace all calls to sqlite3_prepare_v2() with sqlite_prepare() which does
proper error logging.
Fix bug: re-invoking sqlite3_blob_close() on SQLITE_BUSY return causes process
to abort. Use an explicit BEGIN...COMMIT around the blob writing code instead.
Tested using repeated invocations of batphone/tests/meshms1.
Delete deprecated Rhizome db code in rhizome_crypto.c that has been replaced
with keyring file.
2012-08-24 15:38:39 +09:30
Daniel O'Connor
d793dbc948
Restore testframework.sh that I previously rewound.
2012-08-24 15:36:17 +09:30
Daniel O'Connor
0dd2145ed4
assert that the port number matches between calls to overlay_interface_init_any()
2012-08-24 15:21:23 +09:30
Daniel O'Connor
e98ec36391
Set MYSID to my SID before starting the dna helper so it can return it in a SID URI.
2012-08-24 11:43:30 +09:30
Andrew Bettison
bb4819aa83
Issue #2 , sleep-retry logic in all Rhizome operations
...
Much refactoring and removal of cruft.
SQL query errors are now logged with the filename, line number and function
where they were invoked, not of the low-level function that discovered the
error. This makes use of the new __HERE__ notation introduced last commit.
2012-08-23 17:43:35 +09:30
Andrew Bettison
27a0a6eeb5
Introduce struct __sourceloc
...
Replaces (const char *file, unsigned int line, const char *function) arguments
to all logging functions, simplifies malloc/free tracking code in
overlay_buffer.c and Rhizome manifest alloc/free tracking in rhizome_bundle.c.
Use __HERE__ macro instead of (__FILE__, __LINE__, __FUNCTION__) everywhere.
Special __NOWHERE__ macro is equivalent to (NULL, 0, NULL).
Declare net.c functions in new "net.h" header, so log.c doesn't have to pull
in the entire "serval.h" just to use write_str().
Facilitates progress on issue #2 .
2012-08-23 12:31:07 +09:30
Andrew Bettison
fd3da58a7c
Issue #2 , add sleep-retry logic for most database queries
...
All the queries that used sqlite_exec_void() and sqlite_exec_int64() and
sqlite_exec_strbuf() now do a sleep-retry while the Rhizome db is locked.
There are other queries that still need conversion, and some old infinite
retry logic that needs replacing.
2012-08-22 19:09:30 +09:30
Andrew Bettison
65d6bf191a
Fix strbuf API comment
2012-08-22 19:03:00 +09:30
Andrew Bettison
d8fd9fa411
Refactor nanosleep(2) calls into sleep_ms() function
2012-08-21 13:35:33 +09:30
Andrew Bettison
83cb027484
Add FATALF_perror() macro
2012-08-21 13:35:33 +09:30
Andrew Bettison
e534d93a84
Fix tests broken by execpath change
...
Commit 5cbc2167ec
changed the servald 'start'
command to use a different argv[0], which meant that the testdefs.sh
get_servald_pids() function no longer detected running servald processes.
This broke most of the 'server' test cases.
testdefs.sh setup_servald() now makes a full copy of servald once per test
case, not just a symbolic link, so that the logic in get_servald_pids() works
again.
2012-08-21 13:35:33 +09:30