Commit Graph

1214 Commits

Author SHA1 Message Date
Andrew Bettison
3b1adc3a31 Add DEBUG_argv() and WHY_argv() macros
Implemented usng new logArgv() function.

Refactored logMessage()
2012-07-27 18:04:46 +09:30
Andrew Bettison
bbd28eed45 Add strbuf_toprint(), strbuf_toprint_quoted(), etc. 2012-07-27 18:04:46 +09:30
Daniel O'Connor
6d83fddbe5 Rename strnstr as it already exists in FreeBSD & OSX (with different argument ordering).
Arguably we could detect it but I couldn't be bothered dealing with auto*
2012-07-27 16:47:05 +09:30
Andrew Bettison
0dee99dec2 Remove old command-line support 2012-07-27 11:44:20 +09:30
Andrew Bettison
bb5d658779 Rewrite many fprintf(stderr,...) to DEBUGF(...) 2012-07-27 11:29:27 +09:30
Andrew Bettison
62d851f97c Improve DEBUG_GATEWAY debugging
Rewrite all fprintf(stderr,...) to DEBUGF(...)

Improve error reporting from runCommand() and safeSystem(), make them local to
gateway.c
2012-07-27 11:28:14 +09:30
Andrew Bettison
a69f637b3a Replace DEBUG_HLR with DEBUG_KEYRING
Convert several fprintf(stderr,...) into DEBUGF() statements
2012-07-27 11:26:19 +09:30
Andrew Bettison
82648b7e63 Improve logging -- first log INFO message 2012-07-26 18:34:50 +09:30
Andrew Bettison
a6a81a0f64 Improve server signal handling
Use sigaction(2) instead of deprecated signal(2), allowing SEGV et al to be
received in handler and therefore in re-spawned server.

Receive SIGSEGV et al in a separate handler function which kills the server
with the same signal if it does not re-spawn.

Log a GDB backtrace on SEGV et al before exiting or respawning.

Rename config option "serval.respawn_on_signal" to "server.respawn_on_crash".
2012-07-26 18:31:23 +09:30
Andrew Bettison
99ead3b9b1 Add strbuf_append_shell_quote() function 2012-07-26 18:30:24 +09:30
Andrew Bettison
81cafe9d6f Improve log_backtrace() function
Add BACKTRACE macro.  Improve gdb output buffering: log each line individually,
read progressively, reduce buffer size.  Log diagnostics if gdb cannot be run.
2012-07-26 16:51:59 +09:30
Andrew Bettison
ed2410c152 Add strbuf_end() function 2012-07-26 16:47:17 +09:30
Andrew Bettison
6b23bcba51 Enable log_backtrace() on Mac OS X (untested) 2012-07-25 18:19:32 +09:30
Andrew Bettison
e9abed6efb Remove redundant logging from 'dnaprotocol' tests 2012-07-25 18:04:45 +09:30
Andrew Bettison
04b95d2590 Merge branch 'andrew' into 'master' 2012-07-25 18:04:16 +09:30
Andrew Bettison
f2ddc00797 Fix SEGV bug in new overlay abbreviation code 2012-07-25 17:45:57 +09:30
Andrew Bettison
d8fc9bd3c2 Fix DEBUG_OVERLAYEBBREVIATIONS from fprintf(stderr) to DEBUGF() 2012-07-25 17:43:44 +09:30
Andrew Bettison
2b57773472 Add log_backtrace() function 2012-07-25 17:02:57 +09:30
Andrew Bettison
c545061b50 Add server.respawn_on_signal config option 2012-07-25 17:02:57 +09:30
Andrew Bettison
ba69ae616f Improve test framework: fix tfw_core_backtrace
Was not actually printing a gdb backtrace
2012-07-25 17:02:57 +09:30
Jeremy Lakeman
6e7c2196ba Close interfaces on socket errors or when not detected 2012-07-25 16:53:44 +09:30
Jeremy Lakeman
74095e5356 Correctly display interface ip addresses on android 2012-07-25 14:53:53 +09:30
Jeremy Lakeman
5ec739c712 Add performance timing debug option 2012-07-25 13:33:30 +09:30
Jeremy Lakeman
9a16fe4e96 Fix compilation for android 2012-07-24 16:04:59 +09:30
Andrew Bettison
6de247e576 Improve diagnosis of SEGV failures in tests 2012-07-24 15:39:36 +09:30
Andrew Bettison
6b07b4c22e Improve test framework: support gdb core dumps
Add --core-backtrace option to execute() function
Add tfw_core_backtrace() function
2012-07-24 15:38:36 +09:30
Andrew Bettison
54da59bc56 Fix DNA helper so all tests pass
Added a couple more 'dnahelper' tests for timeout conditions
and spurious output
2012-07-24 11:29:07 +09:30
Andrew Bettison
f472ac9a8d Lots of 'dnahelper' tests, all pass but one
Test fails because DNA helper logic does not yet impose a timeout on receiving
the "DONE" ACK after a request.
2012-07-23 18:29:57 +09:30
Andrew Bettison
10fd1c1fc6 Improve test framework: log message from assertStdoutIs 2012-07-23 15:18:11 +09:30
Andrew Bettison
3e0f8df18a Fix bug in DID parsing, affects "set did" command 2012-07-23 15:17:21 +09:30
Andrew Bettison
30567c1d34 Start writing systematic 'dnahelper' tests 2012-07-23 12:23:17 +09:30
Andrew Bettison
0e5c5e0e98 More work on dnahelper, almost done
Servald starts DNA helper, receives startup ACK, sends requests, receives
responses, handles malformed helper responses, echoes dnahelper stderr lines to
log, sends MDP reply packet, waits for dead helper process, all asynchronously.
Shuts down helper process during servald shutdown.

Remaining issues:
 - Does not impose a timeout on helper responses.
 - Only the first URI is reported by the "dna lookup" command.
2012-07-20 18:17:43 +09:30
Andrew Bettison
6bb0d93d85 Add strbuf_tohex() primitive 2012-07-20 18:17:04 +09:30
Andrew Bettison
3b44bb6e58 More progress on dnahelper 2012-07-19 17:59:45 +09:30
Jeremy Lakeman
92297ec67b Merge remote-tracking branch 'origin/master'
Conflicts:
	testframework.sh
2012-07-18 19:37:59 +09:30
Jeremy Lakeman
be857316dc Move reachability test from starting instances to dna protocol tests 2012-07-18 19:35:47 +09:30
Andrew Bettison
5aac5a3854 Unfinished dnahelper implementation 2012-07-18 19:16:30 +09:30
Andrew Bettison
117a3191ab Fix test framework: shorter tmp dir name
So that socket names do not exceed system limit
Also add some comments explaining a few obscure points
2012-07-18 16:29:56 +09:30
Jeremy Lakeman
7678ce8915 Read packed payloads directly from the received buffer 2012-07-18 14:54:23 +09:30
Andrew Bettison
c8a538337d Improve test framework: do not use $BASHPID
Also do not allow -j and --verbose to be given together
2012-07-18 14:44:28 +09:30
Jeremy Lakeman
87515d5dda Allow a frame buffer to wrap an existing buffer 2012-07-18 14:43:14 +09:30
Jeremy Lakeman
66bcc68faa Merge remote-tracking branch 'origin/master' 2012-07-17 18:24:27 +09:30
Jeremy Lakeman
fdc70d7512 Log when a peer becomes reachable or unreachable, edit tests to wait for this message 2012-07-17 18:22:39 +09:30
Andrew Bettison
3c09a1ec7d Fix broken log WARN messages in "rhizome list" 2012-07-17 18:07:02 +09:30
Jeremy Lakeman
6f12edd7a8 Fix compiler warning 2012-07-17 15:59:06 +09:30
Jeremy Lakeman
1d53726b7b Merge remote-tracking branch 'origin/master'
Conflicts:
	rhizome_fetch.c
	rhizome_http.c
	testframework.sh
2012-07-17 15:39:55 +09:30
Andrew Bettison
bc11b16d96 Remove spurious DEBUG() statement 2012-07-17 15:33:04 +09:30
Jeremy Lakeman
ddba8033e4 Refactor packet envelope and sid abbreviation reading and writing 2012-07-17 15:30:50 +09:30
Andrew Bettison
c31d360b7a Improve 'rhizomeprotocol' tests
New test case for big payload (1 MB + 2 bytes)
Check that received payloads are identical to sent ones
Refactored test code
2012-07-17 14:09:35 +09:30
Andrew Bettison
b50943d09c Fix handling of empty payload (filesize = 0)
Do not add 'filehash' var to manifest if filesize=0
Do not accept 'filehash' var when parsing manifest with filesize=0
When responding to a new rhizome advertisement, do not try to HTTP
request a payload if filesize=0, just import the manifest directly
Various operations, eg "rhizome file add", do not report 'filehash'
fields where 'filesize' is zero
Do not delete rows from MANIFESTS table which have empty filehash
Various related bug fixes
2012-07-16 18:40:30 +09:30