mirror of
https://github.com/apache/nuttx.git
synced 2026-05-28 03:45:50 +08:00
net/tcp: syscall send() should not return ETIMEDOUT
Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
committed by
Masayuki Ishikawa
parent
969a06331f
commit
76c64b7d30
@@ -1232,6 +1232,11 @@ ssize_t psock_tcp_send(FAR struct socket *psock, FAR const void *buf,
|
|||||||
tcp_send_gettimeout(start, timeout));
|
tcp_send_gettimeout(start, timeout));
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
|
if (ret == -ETIMEDOUT)
|
||||||
|
{
|
||||||
|
ret = -EAGAIN;
|
||||||
|
}
|
||||||
|
|
||||||
goto errout_with_lock;
|
goto errout_with_lock;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1285,14 +1290,10 @@ ssize_t psock_tcp_send(FAR struct socket *psock, FAR const void *buf,
|
|||||||
|
|
||||||
nerr("ERROR: Failed to allocate write buffer\n");
|
nerr("ERROR: Failed to allocate write buffer\n");
|
||||||
|
|
||||||
if (nonblock)
|
if (nonblock || timeout != UINT_MAX)
|
||||||
{
|
{
|
||||||
ret = -EAGAIN;
|
ret = -EAGAIN;
|
||||||
}
|
}
|
||||||
else if (timeout != UINT_MAX)
|
|
||||||
{
|
|
||||||
ret = -ETIMEDOUT;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
|
|||||||
Reference in New Issue
Block a user