nick
24858fcde5
logging: Add a timestamp to the log messages we emit
2013-06-06 11:57:05 +01:00
nick
21ac3cd0ed
proxy: Deal with close() failures (and EINTR errnos) comprehensively
2013-03-15 12:07:16 +00:00
nick
ac560bd907
serve: Refactor some socket utility code into its own module.
...
We'll be using this in proxy mode later
2013-02-13 13:43:52 +00:00
nick
ecfd108a53
Introduce socket_nbd_write_hello() and a macro to display errno results nicely
2013-02-08 15:53:27 +00:00
Alex Young
15109c72d1
Add a newline to log messages at macro expansion
...
This simplifies building the log output because it means we don't have
to malloc a buffer to append a newline, and we keep the atomic write
property we're after. It also takes advantage of the C constant string
concatenation which we already require to work to prepend the thread and
pid data.
2012-07-13 12:18:19 +01:00
Alex Young
94b4fa887c
Add mboxes
2012-06-27 15:45:33 +01:00
Alex Young
2078d17053
connect failure scenarios
2012-06-22 10:05:41 +01:00
Alex Young
80f298f6cd
Make non-fatal errors return properly
2012-06-21 18:01:56 +01:00
Alex Young
a3dc670939
Squash valgrind errors by making sure client threads get joined on termination
2012-06-21 17:11:12 +01:00
Alex Young
c7525f87dc
Removed proxying completely and fixed the pthread_join bug revealed in the process
2012-06-12 15:08:07 +01:00
Alex Young
2a71b4e7a4
Fix broken error checking around pthread functions
2012-06-11 16:08:19 +01:00
Alex Young
4c52bcd870
Make the error and fatal functions swallow semicolons properly
2012-06-11 15:26:42 +01:00
Alex Young
13a6a403a4
Make the error and fatal macros swallow semicolons properly
2012-06-11 15:23:06 +01:00
Alex Young
83b8b9eaac
Add general-purpose ERROR/FATAL_IF and ERROR/FATAL_UNLESS macros
2012-06-11 15:20:05 +01:00
Alex Young
710d8254d4
Make sure all ifs are braced
2012-06-11 14:34:17 +01:00
Alex Young
25fc0969cf
Make the compiler stricter and tidy up code to make the subsequent errors and warnings go away
2012-06-11 13:57:03 +01:00
Matthew Bloch
b546539ab8
Rewrote error & log functions to be more general, use longjmp to get out of
...
trouble and into predictable cleanup functions (one for each of serve,
client & control contexts). We use 'fatal' to mean 'kill the thread' and
'error' to mean 'don't kill the thread', assuming some recovery action,
except I don't use error anywhere yet.
2012-06-09 02:25:12 +01:00
Alex Young
601e5b475a
Tidy the NULLCHECK macro to swallow semicolons properly
2012-06-07 16:00:38 +01:00
Alex Young
5930f25034
Use client stop signals for thread stopping
2012-06-07 14:25:30 +01:00
Alex Young
a90f84972b
Add stop signals to client threads
2012-06-07 11:44:19 +01:00
Alex Young
074efd9fa4
Add a no-op debug() define for non-debug builds and make valgrind optional in nbd_scenarios
2012-05-31 13:53:04 +01:00
Alex Young
623a398767
Add a --debug flag for DEBUG builds
...
If you compile with:
DEBUG=true rake build
then all the commands get a --debug flag as an option which will make
the server dump crazy amounts of data to stderr.
2012-05-31 13:31:22 +01:00
Alex Young
7832958522
Rearranged the project to have src/ and build/ directories
...
This simplifies keeping everything clean.
2012-05-30 09:51:20 +01:00