modem: simcom-sim7080: fix handling failed fragment send in sendmsg()
If one data fragment was not sent successfully in sendmsg(), then attempting to send the rest does not make any sense, as it would introduce hole in data stream. Currently if one fragment was not sent successfully, then there is a 'break' in inner loop, but that moves the execution to sending the following data fragments. Return early in case of fragment sending failure, so that there are no more send attempts. Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
This commit is contained in:
parent
f6a6843471
commit
032b90845e
1 changed files with 1 additions and 2 deletions
|
@ -468,8 +468,7 @@ static ssize_t offload_sendmsg(void *obj, const struct msghdr *msg, int flags)
|
|||
if (ret == -EAGAIN) {
|
||||
k_sleep(K_SECONDS(1));
|
||||
} else {
|
||||
sent = ret;
|
||||
break;
|
||||
return ret;
|
||||
}
|
||||
} else {
|
||||
sent += ret;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue