query: Simplify riemann_query_new()

When creating a new query object, setting the string cannot fail: we
either died before that point, or bailed out when no query string needs
to be set, or we will succeed (or, again, die without recovery).
Therefore, we can skip an error branch there.

Added comments to clarify the situation, however.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
simple: Clean up some error paths

There were a few error checks that tested for impossible situations,
they were removed, and where appropriate, comments added to explain the
situation.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
message: Error path cleanup

Removed a few error paths that tested for impossible conditions.
Whenever appropriate, added comments explaining why checking for errors
there is not necessary.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
attribute: Simplify riemann_attribute_create()

Since the only way the three functions we call from
riemann_attribute_create() can fail is in OOM situations (in which case
we crash anyway), there is no need to check for impossible error
situations, which means that the function can be cleaned up quite a bit.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
client: Make the internals a bit more testable

Moved the riemann_client_t definition to "riemann/_private.h", so it is
accessible for tests. Also added a test case that tests the disconnect
behaviour with a bad file descriptor.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
client: Error path cleanup

Removed some error checks that checked for impossible situations.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
message: Error path cleanup

Remove argument sanity checking from _riemann_message_combine_events(),
because all callers guarantee that the arguments will be valid.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
Merge branch 'f/error-path-cleanup'