usrsock: Don't clear recvfrom available flag

Don't clear available flag if the response indicate there is more data

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This commit is contained in:
zhanghongyu 2022-03-29 16:47:29 +08:00 committed by Masayuki Ishikawa
parent 01fe37206a
commit e7d1ba157c

View File

@ -83,8 +83,9 @@ static uint16_t recvfrom_event(FAR struct net_driver_s *dev,
pstate->valuelen_nontrunc = conn->resp.valuelen_nontrunc;
}
if (pstate->reqstate.result >= 0 ||
pstate->reqstate.result == -EAGAIN)
if (!(flags & USRSOCK_EVENT_RECVFROM_AVAIL) &&
(pstate->reqstate.result >= 0 ||
pstate->reqstate.result == -EAGAIN))
{
/* After reception of data, mark input not ready. Daemon will
* send event to restore this flag.