From e4f47535ff2f62dc4d83e7fd9612a4a0ec06b070 Mon Sep 17 00:00:00 2001 From: Jean-Roland Date: Wed, 13 Dec 2023 15:28:01 +0100 Subject: [PATCH] fix: flatten tx function --- src/transport/raweth/tx.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/transport/raweth/tx.c b/src/transport/raweth/tx.c index 079a5e0b6..6dd030485 100644 --- a/src/transport/raweth/tx.c +++ b/src/transport/raweth/tx.c @@ -166,13 +166,11 @@ int8_t _z_raweth_link_send_t_msg(const _z_link_t *zl, const _z_transport_message // Prepare buff __unsafe_z_raweth_prepare_header(mzl, &wbf); // Encode the session message - ret = _z_transport_message_encode(&wbf, t_msg); - if (ret == _Z_RES_OK) { - // Write the message header - _Z_RETURN_IF_ERR(__unsafe_z_raweth_write_header(mzl, &wbf)); - // Send the wbuf on the socket - ret = _z_raweth_link_send_wbuf(zl, &wbf); - } + _Z_RETURN_IF_ERR(_z_transport_message_encode(&wbf, t_msg)); + // Write the message header + _Z_RETURN_IF_ERR(__unsafe_z_raweth_write_header(mzl, &wbf)); + // Send the wbuf on the socket + ret = _z_raweth_link_send_wbuf(zl, &wbf); _z_wbuf_clear(&wbf); return ret;