examples/proxy: move error handling out-of-line

Most opcode handlers need to handle errors, and in particular recv
has special handling for -ENOBUFS as that means we ran out of buffers.
Most other opcodes either don't care (we're doing shutdown), or they
simply want to log the error and terminate the connection.

Add a generic logging handler for the opcodes that need that, don't
define one for the ones that don't care, and add a special handler
for receive errors.

This makes the expected non-error case of handling of a request
easier to reason about, as the opcode handlers now only have to deal
with a successful request.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 file changed