Commit e96f1d7b authored by Robert Lubos's avatar Robert Lubos Committed by Anas Nashif
Browse files

net: lib: coap: Fixed unchecked send return value in CoAP client



The retransmission attempt in CoAP client library did not verify the
send result.

Signed-off-by: default avatarRobert Lubos <robert.lubos@nordicsemi.no>
parent 402d4eb0
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -388,9 +388,14 @@ static int handle_poll(struct coap_client *client)
		} else if (ret == 0) {
			if (client->pending.timeout != 0 && coap_pending_cycle(&client->pending)) {
				LOG_ERR("Timeout in poll, retrying send");
				send_request(client->fd, client->request.data,
				ret = send_request(client->fd, client->request.data,
						   client->request.offset, 0, &client->address,
						   client->socklen);
				if (ret < 0) {
					LOG_ERR("Transmission failed: %d", errno);
					ret = -errno;
					break;
				}
			} else {
				/* No more retries left, don't retry */
				LOG_ERR("Timeout in poll, no more retries");