net/tcp: TCP_WAITALL should use state flag

The feature of MSG_WAITALL is broken since the wrong flag is used

Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
chao an 2022-11-21 15:27:47 +08:00 committed by Xiang Xiao
parent 9140b39bde
commit ae4b5b5f50

View File

@ -402,7 +402,8 @@ static uint16_t tcp_recvhandler(FAR struct net_driver_s *dev,
* next receive is performed.
*/
if ((pstate->ir_recvlen > 0 && (flags & TCP_WAITALL) == 0) ||
if ((pstate->ir_recvlen > 0 &&
(pstate->ir_cb->flags & TCP_WAITALL) == 0) ||
pstate->ir_buflen == 0)
{
ninfo("TCP resume\n");