Skip to content

Commit

Permalink
res: ubr: properly error out with warning on lost connection
Browse files Browse the repository at this point in the history
  • Loading branch information
prajnoha committed Aug 6, 2024
1 parent fb7e7df commit 858c337
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/resource/ubridge.c
Original file line number Diff line number Diff line change
Expand Up @@ -5657,8 +5657,12 @@ static int _send_out_cmd_resbuf(sid_res_t *cmd_res)
break;

case MSG_CATEGORY_CLIENT:
conn_res = sid_res_search(cmd_res, SID_RES_SEARCH_IMM_ANC, &sid_res_type_ubr_con, NULL);
conn = sid_res_get_data(conn_res);
if (!(conn_res = sid_res_search(cmd_res, SID_RES_SEARCH_IMM_ANC, &sid_res_type_ubr_con, NULL))) {
sid_res_log_warning(cmd_res, "Connection lost.");
goto out;
}

conn = sid_res_get_data(conn_res);

if ((r = sid_buf_write_all(ucmd_ctx->res_buf, conn->fd)) < 0) {
sid_res_log_error_errno(cmd_res, r, "Failed to send command response to client");
Expand Down

0 comments on commit 858c337

Please sign in to comment.