Skip to content

Commit 4384928

Browse files
Michael Scottjukkar
authored andcommitted
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 <[email protected]>
1 parent 7bce4af commit 4384928

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

subsys/net/lib/mqtt/mqtt.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ int mqtt_tx_connect(struct mqtt_ctx *ctx, struct mqtt_connect_msg *msg)
5353

5454
rc = net_context_send(tx, NULL, ctx->net_timeout, NULL, NULL);
5555
if (rc < 0) {
56-
rc = -EIO;
5756
net_pkt_unref(tx);
5857
}
5958

@@ -93,7 +92,6 @@ int mqtt_tx_disconnect(struct mqtt_ctx *ctx)
9392

9493
rc = net_context_send(tx, NULL, ctx->net_timeout, NULL, NULL);
9594
if (rc < 0) {
96-
rc = -EIO;
9795
goto exit_disconnect;
9896
}
9997

@@ -167,7 +165,6 @@ int mqtt_tx_pub_msgs(struct mqtt_ctx *ctx, u16_t id,
167165

168166
rc = net_context_send(tx, NULL, ctx->net_timeout, NULL, NULL);
169167
if (rc < 0) {
170-
rc = -EIO;
171168
goto exit_send;
172169
}
173170

@@ -229,7 +226,6 @@ int mqtt_tx_publish(struct mqtt_ctx *ctx, struct mqtt_publish_msg *msg)
229226

230227
rc = net_context_send(tx, NULL, ctx->net_timeout, NULL, NULL);
231228
if (rc < 0) {
232-
rc = -EIO;
233229
net_pkt_unref(tx);
234230
}
235231

@@ -268,7 +264,6 @@ int mqtt_tx_pingreq(struct mqtt_ctx *ctx)
268264

269265
rc = net_context_send(tx, NULL, ctx->net_timeout, NULL, NULL);
270266
if (rc < 0) {
271-
rc = -EIO;
272267
goto exit_pingreq;
273268
}
274269

@@ -312,7 +307,6 @@ int mqtt_tx_subscribe(struct mqtt_ctx *ctx, u16_t pkt_id, u8_t items,
312307

313308
rc = net_context_send(tx, NULL, ctx->net_timeout, NULL, NULL);
314309
if (rc < 0) {
315-
rc = -EIO;
316310
net_pkt_unref(tx);
317311
}
318312

@@ -356,7 +350,6 @@ int mqtt_tx_unsubscribe(struct mqtt_ctx *ctx, u16_t pkt_id, u8_t items,
356350

357351
rc = net_context_send(tx, NULL, ctx->net_timeout, NULL, NULL);
358352
if (rc < 0) {
359-
rc = -EIO;
360353
net_pkt_unref(tx);
361354
}
362355

0 commit comments

Comments
 (0)