usrsock_server:fix incomplete received data error
if number of bytes available for reading more than zero,set USRSOCK_EVENT_RECVFROM_AVAIL flag into the event Signed-off-by: wangchen <wangchen41@xiaomi.com>
This commit is contained in:
parent
9b8eedd218
commit
dd0f967798
@ -578,7 +578,6 @@ static int usrsock_rpmsg_recvfrom_handler(FAR struct rpmsg_endpoint *ept,
|
||||
false);
|
||||
if (!iov[i].iov_base)
|
||||
{
|
||||
events |= USRSOCK_EVENT_RECVFROM_AVAIL;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -607,12 +606,16 @@ static int usrsock_rpmsg_recvfrom_handler(FAR struct rpmsg_endpoint *ept,
|
||||
else
|
||||
{
|
||||
iov[i].iov_len = 0;
|
||||
events |= USRSOCK_EVENT_RECVFROM_AVAIL;
|
||||
break;
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
if (usrsock_rpmsg_available(&priv->socks[req->usockid], FIONREAD))
|
||||
{
|
||||
events |= USRSOCK_EVENT_RECVFROM_AVAIL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user