flux-framework/flux-core — pull request #106 by garlick (2014-11-08 00:43:02+00:00)
Title: extend wire protocol

_Do not merge yet - needs further review_

These changes add a new frame to the Flux "standard message" that carries
* A magic value
* The type of the message
* Requests: a destination nodeid (or FLUX_NODEID_ANY)
* Responses: errno value
* (not implemented yet) a sequence number for events

This allows the following improvements:
* Tighten error handling in message routines and add unit tests
* Topic string match can occur without a malloc/free
* Eliminate extra type frame sent over snoop socket
* Eliminate type value sent over API unix domain socket
* Change protocol for error return from json `{errnum:N}` to errno embedded in new frame
* Don't send json frame if it is not needed

Still todo:
* Implement event sequence number and recovery algorithm for missed events at startup
* Handle subscriptions properly (we subscribe to all and drop topics we don't care about in the handle now)
Tests were added for the basic message manipulation functions in `src/common/libflux/message.c`