diff options
author | Michael Scott <michael.scott@linaro.org> | 2017-03-01 23:15:17 -0800 |
---|---|---|
committer | Jukka Rissanen <jukka.rissanen@linux.intel.com> | 2017-04-28 15:01:12 +0300 |
commit | 438492843cef24af9b7c05426e7bfbf0662df4a1 (patch) | |
tree | 2df8b72ebcd8b32ef25ae72317ed60d468e6ecfe | |
parent | 7bce4af81f86366e1f487b676ee8457a5543efe0 (diff) |
net/mqtt: return error codes from net_context_send
Instead of returning EIO let's bubble the error from net_context_send
back up to the caller in the following functions:
mqtt_tx_connect()
mqtt_tx_disconnect()
mqtt_tx_pub_msgs()
mqtt_tx_publish()
mqtt_tx_pingreq()
mqtt_tx_subscribe()
mqtt_tx_unsubscribe()
Change-Id: I9bb4396b227b8902ac1195a97bc37eb1959b643e
Signed-off-by: Michael Scott <michael.scott@linaro.org>
-rw-r--r-- | subsys/net/lib/mqtt/mqtt.c | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/subsys/net/lib/mqtt/mqtt.c b/subsys/net/lib/mqtt/mqtt.c index c7f37f869..bbfb69831 100644 --- a/subsys/net/lib/mqtt/mqtt.c +++ b/subsys/net/lib/mqtt/mqtt.c @@ -53,7 +53,6 @@ int mqtt_tx_connect(struct mqtt_ctx *ctx, struct mqtt_connect_msg *msg) rc = net_context_send(tx, NULL, ctx->net_timeout, NULL, NULL); if (rc < 0) { - rc = -EIO; net_pkt_unref(tx); } @@ -93,7 +92,6 @@ int mqtt_tx_disconnect(struct mqtt_ctx *ctx) rc = net_context_send(tx, NULL, ctx->net_timeout, NULL, NULL); if (rc < 0) { - rc = -EIO; goto exit_disconnect; } @@ -167,7 +165,6 @@ int mqtt_tx_pub_msgs(struct mqtt_ctx *ctx, u16_t id, rc = net_context_send(tx, NULL, ctx->net_timeout, NULL, NULL); if (rc < 0) { - rc = -EIO; goto exit_send; } @@ -229,7 +226,6 @@ int mqtt_tx_publish(struct mqtt_ctx *ctx, struct mqtt_publish_msg *msg) rc = net_context_send(tx, NULL, ctx->net_timeout, NULL, NULL); if (rc < 0) { - rc = -EIO; net_pkt_unref(tx); } @@ -268,7 +264,6 @@ int mqtt_tx_pingreq(struct mqtt_ctx *ctx) rc = net_context_send(tx, NULL, ctx->net_timeout, NULL, NULL); if (rc < 0) { - rc = -EIO; goto exit_pingreq; } @@ -312,7 +307,6 @@ int mqtt_tx_subscribe(struct mqtt_ctx *ctx, u16_t pkt_id, u8_t items, rc = net_context_send(tx, NULL, ctx->net_timeout, NULL, NULL); if (rc < 0) { - rc = -EIO; net_pkt_unref(tx); } @@ -356,7 +350,6 @@ int mqtt_tx_unsubscribe(struct mqtt_ctx *ctx, u16_t pkt_id, u8_t items, rc = net_context_send(tx, NULL, ctx->net_timeout, NULL, NULL); if (rc < 0) { - rc = -EIO; net_pkt_unref(tx); } |