Commit 688412ff authored by Anders Blomdell's avatar Anders Blomdell
Browse files

Call handler only when reader is without errors.

parent d8cab5f2
......@@ -259,11 +259,13 @@ static void call_handler(void *value, void *context)
{
struct call_handler_context *wrap = context;
labcomm_reader_start(wrap->reader, wrap->reader->action_context,
wrap->local_index, wrap->remote_index, wrap->signature,
value);
wrap->handler(value, wrap->context);
labcomm_reader_end(wrap->reader, wrap->reader->action_context);
if (wrap->reader->error >= 0) {
labcomm_reader_start(wrap->reader, wrap->reader->action_context,
wrap->local_index, wrap->remote_index, wrap->signature,
value);
wrap->handler(value, wrap->context);
labcomm_reader_end(wrap->reader, wrap->reader->action_context);
}
}
static void reader_alloc(struct labcomm_decoder *d)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment