Loading src/lib/bus/bus_types.h +1 −1 Original line number Diff line number Diff line Loading @@ -197,7 +197,7 @@ typedef enum { typedef enum { BUS_SEND_UNDEFINED = 0, BUS_SEND_REQUEST_COMPLETE = 1, BUS_SEND_SUCCESS = 2, BUS_SEND_SUCCESS = 3, BUS_SEND_TX_TIMEOUT = -51, BUS_SEND_TX_FAILURE = -52, // -> socket error BUS_SEND_RX_TIMEOUT = -53, Loading src/lib/bus/listener.c +1 −0 Original line number Diff line number Diff line Loading @@ -161,6 +161,7 @@ bool listener_expect_response(struct listener *l, boxed_msg *box, msg->type = MSG_EXPECT_RESPONSE; msg->u.expect.box = box; *backpressure = ListenerTask_GetBackpressure(l); BUS_ASSERT(b, b->udata, box->result.status != BUS_SEND_UNDEFINED); bool pm = listener_helper_push_message(l, msg, NULL); if (!pm) { Loading src/lib/bus/listener_cmd.c +3 −0 Original line number Diff line number Diff line Loading @@ -250,6 +250,9 @@ static void expect_response(listener *l, struct boxed_msg *box) { info->u.expect.box = box; info->u.expect.has_result = true; info->u.expect.result = result; BUS_ASSERT(b, b->udata, box->result.status != BUS_SEND_UNDEFINED); ListenerTask_AttemptDelivery(l, info); } else { BUS_LOG_SNPRINTF(b, 3, LOG_LISTENER, b->udata, 256, Loading src/lib/bus/listener_task.c +1 −0 Original line number Diff line number Diff line Loading @@ -319,6 +319,7 @@ void ListenerTask_NotifyMessageFailure(listener *l, BUS_ASSERT(b, b->udata, info->state == RIS_EXPECT); BUS_ASSERT(b, b->udata, info->u.expect.box); BUS_ASSERT(b, b->udata, status != BUS_SEND_UNDEFINED); info->u.expect.box->result.status = status; boxed_msg *box = info->u.expect.box; Loading src/lib/bus/send.c +4 −6 Original line number Diff line number Diff line Loading @@ -45,7 +45,7 @@ int poll_errno = 0; int write_errno = 0; #endif static bool attempt_to_enqueue_hold_message_to_listener(struct bus *b, static bool attempt_to_enqueue_HOLD_message_to_listener(struct bus *b, int fd, int64_t seq_id, int16_t timeout_sec); /* Do a blocking send. * Loading Loading @@ -96,7 +96,7 @@ bool send_do_blocking_send(bus *b, boxed_msg *box) { * EXPECT hasn't, leading to ambiguity about what to do with * the response (which may or may not have arrived). * */ if (!attempt_to_enqueue_hold_message_to_listener(b, if (!attempt_to_enqueue_HOLD_message_to_listener(b, box->fd, box->out_seq_id, box->timeout_sec + 5)) { return false; } Loading Loading @@ -159,9 +159,6 @@ bool send_do_blocking_send(bus *b, boxed_msg *box) { case SHHW_OK: continue; case SHHW_DONE: box->result = (bus_msg_result_t){ .status = BUS_SEND_REQUEST_COMPLETE, }; return true; case SHHW_ERROR: return true; Loading @@ -182,7 +179,7 @@ bool send_do_blocking_send(bus *b, boxed_msg *box) { return true; } static bool attempt_to_enqueue_hold_message_to_listener(struct bus *b, static bool attempt_to_enqueue_HOLD_message_to_listener(struct bus *b, int fd, int64_t seq_id, int16_t timeout_sec) { BUS_LOG_SNPRINTF(b, 5, LOG_SENDER, b->udata, 128, "telling listener to expect response, with <fd%d, seq_id:%lld>", Loading @@ -207,6 +204,7 @@ void send_handle_failure(struct bus *b, boxed_msg *box, bus_send_status_t status BUS_LOG_SNPRINTF(b, 5, LOG_SENDER, b->udata, 64, "send_handle_failure: box %p, <fd:%d, seq_id:%lld>, status %d", (void*)box, box->fd, (long long)box->out_seq_id, status); BUS_ASSERT(b, b->udata, status != BUS_SEND_UNDEFINED); box->result = (bus_msg_result_t){ .status = status, Loading Loading
src/lib/bus/bus_types.h +1 −1 Original line number Diff line number Diff line Loading @@ -197,7 +197,7 @@ typedef enum { typedef enum { BUS_SEND_UNDEFINED = 0, BUS_SEND_REQUEST_COMPLETE = 1, BUS_SEND_SUCCESS = 2, BUS_SEND_SUCCESS = 3, BUS_SEND_TX_TIMEOUT = -51, BUS_SEND_TX_FAILURE = -52, // -> socket error BUS_SEND_RX_TIMEOUT = -53, Loading
src/lib/bus/listener.c +1 −0 Original line number Diff line number Diff line Loading @@ -161,6 +161,7 @@ bool listener_expect_response(struct listener *l, boxed_msg *box, msg->type = MSG_EXPECT_RESPONSE; msg->u.expect.box = box; *backpressure = ListenerTask_GetBackpressure(l); BUS_ASSERT(b, b->udata, box->result.status != BUS_SEND_UNDEFINED); bool pm = listener_helper_push_message(l, msg, NULL); if (!pm) { Loading
src/lib/bus/listener_cmd.c +3 −0 Original line number Diff line number Diff line Loading @@ -250,6 +250,9 @@ static void expect_response(listener *l, struct boxed_msg *box) { info->u.expect.box = box; info->u.expect.has_result = true; info->u.expect.result = result; BUS_ASSERT(b, b->udata, box->result.status != BUS_SEND_UNDEFINED); ListenerTask_AttemptDelivery(l, info); } else { BUS_LOG_SNPRINTF(b, 3, LOG_LISTENER, b->udata, 256, Loading
src/lib/bus/listener_task.c +1 −0 Original line number Diff line number Diff line Loading @@ -319,6 +319,7 @@ void ListenerTask_NotifyMessageFailure(listener *l, BUS_ASSERT(b, b->udata, info->state == RIS_EXPECT); BUS_ASSERT(b, b->udata, info->u.expect.box); BUS_ASSERT(b, b->udata, status != BUS_SEND_UNDEFINED); info->u.expect.box->result.status = status; boxed_msg *box = info->u.expect.box; Loading
src/lib/bus/send.c +4 −6 Original line number Diff line number Diff line Loading @@ -45,7 +45,7 @@ int poll_errno = 0; int write_errno = 0; #endif static bool attempt_to_enqueue_hold_message_to_listener(struct bus *b, static bool attempt_to_enqueue_HOLD_message_to_listener(struct bus *b, int fd, int64_t seq_id, int16_t timeout_sec); /* Do a blocking send. * Loading Loading @@ -96,7 +96,7 @@ bool send_do_blocking_send(bus *b, boxed_msg *box) { * EXPECT hasn't, leading to ambiguity about what to do with * the response (which may or may not have arrived). * */ if (!attempt_to_enqueue_hold_message_to_listener(b, if (!attempt_to_enqueue_HOLD_message_to_listener(b, box->fd, box->out_seq_id, box->timeout_sec + 5)) { return false; } Loading Loading @@ -159,9 +159,6 @@ bool send_do_blocking_send(bus *b, boxed_msg *box) { case SHHW_OK: continue; case SHHW_DONE: box->result = (bus_msg_result_t){ .status = BUS_SEND_REQUEST_COMPLETE, }; return true; case SHHW_ERROR: return true; Loading @@ -182,7 +179,7 @@ bool send_do_blocking_send(bus *b, boxed_msg *box) { return true; } static bool attempt_to_enqueue_hold_message_to_listener(struct bus *b, static bool attempt_to_enqueue_HOLD_message_to_listener(struct bus *b, int fd, int64_t seq_id, int16_t timeout_sec) { BUS_LOG_SNPRINTF(b, 5, LOG_SENDER, b->udata, 128, "telling listener to expect response, with <fd%d, seq_id:%lld>", Loading @@ -207,6 +204,7 @@ void send_handle_failure(struct bus *b, boxed_msg *box, bus_send_status_t status BUS_LOG_SNPRINTF(b, 5, LOG_SENDER, b->udata, 64, "send_handle_failure: box %p, <fd:%d, seq_id:%lld>, status %d", (void*)box, box->fd, (long long)box->out_seq_id, status); BUS_ASSERT(b, b->udata, status != BUS_SEND_UNDEFINED); box->result = (bus_msg_result_t){ .status = status, Loading