msgr: miscellaneous fixes.

Indentation on a public label; various function documentation; remove
an inappropriate definition of a virtual function, and an unused function;
msgr: Reorder functions to reduce the number of privacy tags.

No functional changes.

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
msgr: dispatcher: Documentation of security functions

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
msgr: remove several functions from the interface.

The suicide() function is unused and its current SimpleMessenger
implementation just calls shutdown(). And I don't see any good
uses for suicide functionality that are distinct from exit() or assert(0).

The lazy_send_message() definition shouldn't alias onto regular
send_message(), and leaving it in is likely to confuse implementers
and users.

prepare_dest() is unused and has been superseded by get_connection().

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
msgr: Document all the functions in the Messenger interface.

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
msgr: group functions more appropriately

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
msgr: remove out-of-date comments and function

I think that destroy() is left over from a misinformed attempt
to implement refcounting on the Messenger.

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
msgr: add a little detail to mark_down_on_empty() and mark_disposable()

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
msgr: Group the SimpleMessenger functions following the Messenger's pattern

Ordering everything nicely will make for a cleaner interface, make
it easier to see what documentation we need, and make the warts
we have poking out a lot more noticeable.

I don't think this changes the interface at all, except it makes
read() protected (instead of public).

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
msgr: Document remaining SimpleMessenger functions and data members

This doesn't handle the inner classes (Pipe, mostly) yet. It also
raises questions about whether these functions should be public, or if
we should declare all the inner classes friends.
After talking it over, I think we want them to be public, since
the Messenger interface is the important abstraction. But that
will require reworking some stuff anyway to make it consistent. ;)

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
msgr: move SimpleMessenger function declarations into good order

We now have one declaration each of private and protected, and two
declarations of public -- one for the Messenger-required functions,
and one for the "internal" public functions. They're also in
some semblance of a readable order.

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
msgr: convert get_policy() to return a const reference.

The only user who didn't want a const should have been using
direct access anyway (and now is doing so).

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
msgr: convert global_seq_lock to a spinlock.

Because nobody wants to get put to sleep waiting on a unique integer.
(I would just make this an atomic_t but we need to be able to accept
higher values from remote endpoints.)

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
msgr: add some validity checks to ~SimpleMessenger()

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
msgr: add error code returns to send_keepalive.

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
msgr: make mark_down_on_empty() behave more consistently.

Previously you could get ms_handle_reset() notifications if you
used mark_down_on_empty(), but only if the Pipe's queue wasn't
empty at the time. Fix that by simply calling stop() instead
of fault(), which is more appropriate for the circumstances anyway.

Also fix the documentation, which was in fact incorrect.

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
msgr: group private data members by type

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
msgr: reorder the SimpleMessenger data members a little bit

They make moderately more sense to me in this order.

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
msgr: minimally document the SimpleMessenger inner classes

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
msgr: fix some spacing issues in Pipe

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>