Daniel O'Connor
38bf7c3a67
Don't hand roll socket name generation. Don't check if it's abstract (since the paths start with nul it was a NOP previously anyway).
2012-06-24 14:32:26 +09:30
Daniel O'Connor
626ddee8da
Change monitor.socket and mdp.socket prefs to be a suffix which is applied to the instance directory (normal) or org.servalproject.servald (abstract)
2012-06-24 14:26:43 +09:30
Daniel O'Connor
719d1fe72c
Add option to set SO_REUSEADDR to socket_bind() and use it.
2012-06-24 14:25:58 +09:30
Daniel O'Connor
4861ff9252
Call a function to cleanup various sockets properly.
2012-06-24 14:24:58 +09:30
Daniel O'Connor
aac5a4c275
Set c-basic-offset to 2 for all files.
2012-06-24 13:41:49 +09:30
Daniel O'Connor
523c9ad49f
Push debug knobs into a separate makefile so I don't have to run configure when I change them.
2012-06-24 00:40:54 +09:30
Daniel O'Connor
c4f19f8a82
Factor out code to fill in a sockaddr_un to a single function and remove overlay_mdp.c's duplicate socket handling (which was incomplete).
...
All platforms except Android use normal sockets (although this is easy to change and the choice is keyed off a single define).
This gives consistent handling to unix domain sockets which were previously a mishmash where some were always normal, some always abstract and some chose (but in different ways). It also gives consistent error checking.
Doesn't pass tests yet though.
2012-06-24 00:38:47 +09:30
Daniel O'Connor
510711586f
Check the socket isn't too long before copying it to prevent a seg fault.
2012-06-22 21:47:30 +09:30
Daniel O'Connor
00f66063d4
The number of clients we have is not a warning.
2012-06-22 20:42:05 +09:30
Daniel O'Connor
2fe520f7a2
Fix peer credential checking on BSD, replace write(s, m, strlen(m)) with a macro, factor out new monitor socke code.
...
Note this code has issues with signed/unsigned chars. They should become uint8_t's if they hold binary data, otherwise just char. If they ARE binary then it is broken because it calls strlen() on them.
2012-06-22 20:40:30 +09:30
Daniel O'Connor
8d7b0d259f
Add a compile time knob to disable timing checks (on by default now).
2012-06-22 20:40:29 +09:30
Daniel O'Connor
59ff806081
Don't pass the configuration value as the format string.
2012-06-22 20:40:29 +09:30
Daniel O'Connor
41a7588a7f
Fix creation of socket name for !linux. Depressingly bind() doesn't fail when you pass it the name of a directory.
2012-06-22 20:40:29 +09:30
Andrew Bettison
c041048958
Fix servald server test assertion messages
2012-06-22 17:32:42 +09:30
Andrew Bettison
dfc8136b11
Merge branch 'andrew'
2012-06-22 17:26:52 +09:30
Andrew Bettison
a6ac6a4246
Improve servald logging
...
Use 'logfile' config entry, fall back to stderr if absent or can't be opened
Replace fprintf(stderr,...) with DEBUGF() in dump() and dumpResponses()
2012-06-22 17:19:14 +09:30
Andrew Bettison
de4a9a1318
Improve server tests: server log file assertions
2012-06-22 17:18:14 +09:30
Andrew Bettison
cf03033429
Improve test framework: assertGrep error on bad file
2012-06-22 17:16:43 +09:30
Daniel O'Connor
60512ad3e8
Fix build breakage.
2012-06-22 16:46:30 +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
aedb31e451
Improve test definitions
...
Better instance handling primitives
Fix get_servald_pids() to work on Linux and Mac (allegedly!)
2012-06-22 15:56:28 +09:30
Andrew Bettison
6af6d5ee7e
Fix testing kill_all_servald_processes() function
...
dnaprotcol tests now always PASS
2012-06-22 14:18:05 +09:30
Andrew Bettison
3a6ea4ad75
Move test fixture code into setup_...() functions
2012-06-22 13:19:28 +09:30
Andrew Bettison
274e5c007c
Merge branch 'master' into andrew
...
Conflicts:
log.c
2012-06-22 11:18:48 +09:30
Andrew Bettison
362f4b4ed8
Remove sensitive data from debug
2012-06-21 18:38:52 +09:30
gardners
2d718a297f
reversed changes that broke DNA tests. Improved dnaprotocol
...
test script slightly.
2012-06-21 17:02:36 +09:30
gardners
8977142a30
fixed "timeout from MDP server" errors in node info output.
...
added extra tests for node info.
2012-06-21 16:36:38 +09:30
gardners
a4d575d87a
added test to make sure that DNA lookups by number work as advertised.
2012-06-21 16:36:38 +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
fa1cef7f3b
fixed bugs in dnaprotocol test script to work.
2012-06-21 16:36:38 +09:30
gardners
136a7bcf56
fixed bug with absolute-path dummynet files.
...
added pid of producer to dummynet packets.
2012-06-21 16:36:38 +09:30
gardners
5e338f6285
make tests faster to run.
2012-06-21 16:36:37 +09:30
gardners
48a1d7e20f
MDP socket name can now be changed by config option mdp.socket.
...
DNA tests now passing again.
2012-06-21 16:36:37 +09:30
gardners
01712ab67e
monitor.socket config option added to allow multiple servald
...
instances on the same machine without conflicting abstract namespace
unix domain sockets for monitor interface.
2012-06-21 16:36:37 +09:30
gardners
22ebdbc1ae
work on getting multiple dna instances running in test framework.
2012-06-21 16:36:37 +09:30
gardners
5d3e9a21f7
fixed bug with interface specifications to allow - in dummynet paths.
2012-06-21 16:36:37 +09:30
gardners
fefe7d2e91
fixed dna query bugs and split wildcard query test into star and
...
empty string versions.
2012-06-21 16:36:37 +09:30
gardners
c3649c415f
fixed a bug with DNA response generation.
2012-06-21 16:36:37 +09:30
gardners
2a6cdc0389
got wildcard search for self test functioning.
2012-06-21 16:36:37 +09:30
gardners
2aa06ea84b
added new test for dnaprotocol
2012-06-21 16:36:37 +09:30
gardners
374e4676a7
various simplifications of DNA reply generation and related code.
2012-06-21 16:36:37 +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
50eaeca51a
added sanity checking of poll timeout to prevent infinite wait
...
if any ticks are overdue (this whole thing will be revamped soon
to be simpler and more efficient, so this is a temporary solution).
2012-06-21 16:36:37 +09:30
gardners
89d036822b
added code to start dna helper, and detect when it has failed
...
and restart it.
2012-06-21 16:35:53 +09:30
gardners
dceeed8d35
more work on dna helper interface.
...
Also added missing dna_helper.c file from previous changes.
moved sigpipe/sigio detection code to own file.
2012-06-21 16:35:28 +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
500b9f9f28
fixed a memory leak, more to find.
2012-06-21 11:33:43 +09:30