Commit Graph

213 Commits

Author SHA1 Message Date
Andrew Bettison
d8fd9fa411 Refactor nanosleep(2) calls into sleep_ms() function 2012-08-21 13:35:33 +09:30
Daniel O'Connor
fc20a4768d Use get_self_executable_path to resolve our name when calling
exec otherwise it will fail when given a relative path as we
chdir to / before trying it.
2012-08-20 15:02:00 +09:30
Jeremy Lakeman
3ab79d8e5b Pass phone numbers in vomp call initiation 2012-08-13 14:01:57 +09:30
Daniel O'Connor
f453071251 Fix compilation in the non-JNI case 2012-08-10 16:55:38 +09:30
Jeremy Lakeman
f77e055988 Add timeout argument for dna lookup 2012-08-10 15:29:19 +09:30
Andrew Bettison
12d8bc0c12 Use new typedef time_ms_t everywhere 2012-08-09 12:14:32 +09:30
Andrew Bettison
f37ec5af09 Reduce use of stderr in many places
serval_packetvisualise() is now replaced by DEBUG_packet_visualise() which uses
logging system not stderr (so now it will appear in Android log).

Replaced several fprintf(stderr,...) with DEBUGF(...).

Command line only prints a full help message on "help" command -- a command
parse failure simply informs the user about the "help" command.
2012-08-01 17:54:02 +09:30
Andrew Bettison
240be25793 Replace overlay_gettime_ms() with gettime_ms() 2012-07-30 17:22:38 +09:30
Daniel O'Connor
09d0fecf28 Remove carnal knowledge of conf.c from serval.h and commandline.c by providing a function to set the instance path override. 2012-07-29 18:58:41 +09:30
Andrew Bettison
8db737ee6f Quieten startup logging a bit 2012-07-27 19:59:16 +09:30
Andrew Bettison
2152c9267f DEBUG_VERBOSE log messages for all command-line commands 2012-07-27 18:04:46 +09:30
Andrew Bettison
04b95d2590 Merge branch 'andrew' into 'master' 2012-07-25 18:04:16 +09:30
Jeremy Lakeman
5ec739c712 Add performance timing debug option 2012-07-25 13:33:30 +09:30
Andrew Bettison
6de247e576 Improve diagnosis of SEGV failures in tests 2012-07-24 15:39:36 +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
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
5aac5a3854 Unfinished dnahelper implementation 2012-07-18 19:16:30 +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
Andrew Bettison
208a95a233 Replace validateSid() with str_is_subscriber_id() 2012-07-12 16:14:25 +09:30
Andrew Bettison
d2898ee22c Add output fields to 'keyring add' command 2012-07-06 13:17:53 +09:30
Andrew Bettison
ab64b08ceb Rewrite config file code
Gets rid of rotor in confValueGet() and duplicate config file parsing code
Currently fails three tests
2012-07-04 18:57:02 +09:30
Andrew Bettison
68ef34c119 Add 'id allpeers' command to facilitate testing 2012-07-04 12:06:15 +09:30
Andrew Bettison
2c87039307 Replace overlay_render_sid() with alloca_tohex_sid()
To eliminate timebomb bugs caused by rotor wraparound
2012-07-03 17:59:30 +09:30
gardners
02ca21a601 CHANGED DNA REPLY PACKET FORMAT BREAKING BACKWARDS COMPATIBILITY
... as part of working on work on DNA helper callout facility.
(DNA replies now contain a token that can be used to match them
against DNA requests as a happy side-effect).
2012-07-03 16:45:03 +09:30
Jeremy Lakeman
495de9e0ec Add more profiling instrumentation 2012-07-03 15:50:04 +09:30
Andrew Bettison
8020ea3b74 Merge branch 'eventscheduler' into master
Conflicts:
	commandline.c
	monitor.c
	overlay.c
	overlay_interface.c
	overlay_packetformats.c
	rhizome_fetch.c
	rhizome_http.c
	rhizome_packetformats.c
	serval.h
	server.c
	testdefs.sh
	testframework.sh
	tests/dnaprotocol
	tests/server
2012-07-03 10:26:22 +09:30
Andrew Bettison
fc8df7d5d4 Config options for tick duration 2012-07-02 12:26:01 +09:30
Andrew Bettison
b368a3aab4 Add confValueGetInt64() function 2012-06-28 18:19:36 +09:30
Andrew Bettison
b9836af8a2 Fix debug logging in overlay_interface.c
Also fix bug that closed the logfile when forking the server process.
2012-06-28 17:34:21 +09:30
Andrew Bettison
9625190c6a Improve debug code:
Debug bit mask is unsigned int everywhere.
Refactor DEBUG() macros a bit.
Add SERVALD_DEBUG_FILE env var to support test scripts.
Test defs put instance directories under $TFWVAR not $TFWTMP.
2012-06-28 15:24:43 +09:30
Andrew Bettison
3822d067e7 Remove unnecessary double-fork from server start 2012-06-26 17:27:19 +09:30
Andrew Bettison
889f9c4628 Re-instate prior server start code
Do not use server_probe().
Use setsid() instead of setpgrp().
Still uses double-fork technique, as advised in setsid(2) man page.
Return exit status 10 if already running, instead of logging an error and exit
status 255.
2012-06-26 16:07:24 +09:30
Andrew Bettison
19f7e32ba7 Re-instate prior server start code
Uses setsid() instead of setpgrp().
Still uses double-fork technique, as advised in setsid(2) man page.
Does not use server_probe().
2012-06-26 15:46:10 +09:30
Jeremy Lakeman
0ca4c16f39 Refactor node info to ignore stale responses without sending another request 2012-06-26 11:20:00 +09:30
gardners
b40a468276 Merge branch 'eventscheduler'
Conflicts:
	monitor.c
	serval.h
2012-06-25 16:50:23 +09:30
Andrew Bettison
1fbf957a9d Clean up compiler warnings in commandline.c 2012-06-25 15:06:35 +09:30
Daniel O'Connor
05d8ac5d05 Don't treat the server already running as an error otherwise the Java code complains.
Emit a useful error if we couldn't get the PID.
2012-06-25 14:14:33 +09:30
Daniel O'Connor
8ad51554b4 Use the right variable to display the PID. 2012-06-25 14:11:16 +09:30
Daniel O'Connor
b0dad81b0c Don't call daemon as the parent can't exit in JNI otherwise bad things will happen.
Copy the code for daemon from FreeBSD 8.x instead of the flying circus that was there before.
2012-06-25 14:01:50 +09:30
Daniel O'Connor
5103176d39 Remove server_probe() and use daemon() instead of a hand rolled version.
- server_probe() assumes abstract name space sockets.
- The hand rolled daemon doesn't work properly on BSD.
2012-06-22 16:05:43 +09:30
Andrew Bettison
274e5c007c Merge branch 'master' into andrew
Conflicts:
	log.c
2012-06-22 11:18:48 +09:30
gardners
0254ca0ab8 made dnaprotocol test more rigorous to ensure it really returns
results from each SID/servald instance.
Fixed bug in "keyring list" that was returning keyrings in
lower case instead of normalised form using overlay_render_sid()
2012-06-21 16:36:38 +09:30
gardners
2cb84bb8db various fixes to new DNA URI response relating to parsing replies
that lacked DID and/or name field.
2012-06-21 16:36:37 +09:30
gardners
e5394dd143 added stubs for DNA lookup helper app (not yet complete).
cleaned up some unused variables.
2012-06-21 16:35:28 +09:30
gardners
3281f2c652 fixed introduced bug where "node info" failed to provide automatic
resolution of DIDs and names for local identities.
2012-06-21 11:45:20 +09:30
gardners
30e254560a node info now understands new dna response packet format. 2012-06-21 11:45:07 +09:30
gardners
8ea37af64d servald now can return arbitrary URIs in response to DNA requests. 2012-06-21 11:44:49 +09:30
gardners
b48fdb6567 added deeper timing checks to reveal that rhizome advertisements
are the slowest part -- need to add caching of manifests so that
we don't hit the database every interface tick.
2012-06-21 11:33:43 +09:30