You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/06/27 07:12:04 UTC
[GitHub] [incubator-nuttx] xiaoxiang781216 opened a new pull request, #6529: net: Ensure sendmsg and sendfile return -EAGAIN in case of timeout
xiaoxiang781216 opened a new pull request, #6529:
URL: https://github.com/apache/incubator-nuttx/pull/6529
## Summary
instead of -ETIMEOUT, as specify here:
https://pubs.opengroup.org/onlinepubs/009604599/functions/sendmsg.html
https://man7.org/linux/man-pages/man2/sendfile.2.html
## Impact
More compatible to standard
## Testing
Pass CI
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] pkarashchenko commented on a diff in pull request #6529: net: Ensure sendmsg and sendfile return -EAGAIN in case of timeout
Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on code in PR #6529:
URL: https://github.com/apache/incubator-nuttx/pull/6529#discussion_r907187495
##########
net/icmp/icmp_sendmsg.c:
##########
@@ -424,6 +424,8 @@ ssize_t icmp_sendmsg(FAR struct socket *psock, FAR struct msghdr *msg,
{
if (ret == -ETIMEDOUT)
{
+ ret = -EAGAIN;
Review Comment:
Maybe we can move this as `else` for `if (!net_ipv4addr_maskcmp(state.snd_toaddr, dev->d_ipaddr, dev->d_netmask))`?
##########
net/icmpv6/icmpv6_sendmsg.c:
##########
@@ -415,6 +415,8 @@ ssize_t icmpv6_sendmsg(FAR struct socket *psock, FAR struct msghdr *msg,
{
if (ret == -ETIMEDOUT)
{
+ ret = -EAGAIN;
Review Comment:
Maybe can move it to `else` statement below?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] pkarashchenko commented on a diff in pull request #6529: net: Ensure sendmsg and sendfile return -EAGAIN in case of timeout
Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on code in PR #6529:
URL: https://github.com/apache/incubator-nuttx/pull/6529#discussion_r907068209
##########
net/sixlowpan/sixlowpan_tcpsend.c:
##########
@@ -660,6 +660,11 @@ static int sixlowpan_send_packet(FAR struct socket *psock,
ret = net_timedwait(&sinfo.s_waitsem, timeout);
if (ret != -ETIMEDOUT || acked == sinfo.s_acked)
{
+ if (ret == -ETIMEOUT)
Review Comment:
```suggestion
if (ret == -ETIMEDOUT)
```
##########
net/tcp/tcp_send_unbuffered.c:
##########
@@ -680,6 +680,11 @@ ssize_t psock_tcp_send(FAR struct socket *psock,
_SO_TIMEOUT(conn->sconn.s_sndtimeo));
if (ret != -ETIMEDOUT || acked == state.snd_acked)
{
+ if (ret == -ETIMEOUT)
Review Comment:
```suggestion
if (ret == -ETIMEDOUT)
```
##########
net/tcp/tcp_sendfile.c:
##########
@@ -583,6 +583,11 @@ ssize_t tcp_sendfile(FAR struct socket *psock, FAR struct file *infile,
&state.snd_sem, _SO_TIMEOUT(conn->sconn.s_sndtimeo));
if (ret != -ETIMEDOUT || acked == state.snd_acked)
{
+ if (ret == -ETIMEOUT)
Review Comment:
```suggestion
if (ret == -ETIMEDOUT)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] pkarashchenko commented on a diff in pull request #6529: net: Ensure sendmsg and sendfile return -EAGAIN in case of timeout
Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on code in PR #6529:
URL: https://github.com/apache/incubator-nuttx/pull/6529#discussion_r907064003
##########
net/sixlowpan/sixlowpan_tcpsend.c:
##########
@@ -660,6 +660,11 @@ static int sixlowpan_send_packet(FAR struct socket *psock,
ret = net_timedwait(&sinfo.s_waitsem, timeout);
if (ret != -ETIMEDOUT || acked == sinfo.s_acked)
Review Comment:
Condition `ret != -ETIMEDOUT` here and then checking for `if (ret == -ETIMEDOUT)` makes me feel a bit uncomfortable, but I assume that we are seeking for the `acked == sinfo.s_acked` condition here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a diff in pull request #6529: net: Ensure sendmsg and sendfile return -EAGAIN in case of timeout
Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #6529:
URL: https://github.com/apache/incubator-nuttx/pull/6529#discussion_r907105001
##########
net/sixlowpan/sixlowpan_tcpsend.c:
##########
@@ -660,6 +660,11 @@ static int sixlowpan_send_packet(FAR struct socket *psock,
ret = net_timedwait(&sinfo.s_waitsem, timeout);
if (ret != -ETIMEDOUT || acked == sinfo.s_acked)
Review Comment:
Yes, we may break the loop due to acked == sinfo.s_acked, but the return value is -ETIMEDOUT.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] pkarashchenko commented on a diff in pull request #6529: net: Ensure sendmsg and sendfile return -EAGAIN in case of timeout
Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on code in PR #6529:
URL: https://github.com/apache/incubator-nuttx/pull/6529#discussion_r907064003
##########
net/sixlowpan/sixlowpan_tcpsend.c:
##########
@@ -660,6 +660,11 @@ static int sixlowpan_send_packet(FAR struct socket *psock,
ret = net_timedwait(&sinfo.s_waitsem, timeout);
if (ret != -ETIMEDOUT || acked == sinfo.s_acked)
Review Comment:
Condition `ret != -ETIMEDOUT` here and then checking for `if (ret == -ETIMEOUT)` makes me feel a bit uncomfortable, but I assume that we are seeking for the `acked == sinfo.s_acked` condition here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a diff in pull request #6529: net: Ensure sendmsg and sendfile return -EAGAIN in case of timeout
Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #6529:
URL: https://github.com/apache/incubator-nuttx/pull/6529#discussion_r907216655
##########
net/icmpv6/icmpv6_sendmsg.c:
##########
@@ -415,6 +415,8 @@ ssize_t icmpv6_sendmsg(FAR struct socket *psock, FAR struct msghdr *msg,
{
if (ret == -ETIMEDOUT)
{
+ ret = -EAGAIN;
Review Comment:
Done.
##########
net/icmp/icmp_sendmsg.c:
##########
@@ -424,6 +424,8 @@ ssize_t icmp_sendmsg(FAR struct socket *psock, FAR struct msghdr *msg,
{
if (ret == -ETIMEDOUT)
{
+ ret = -EAGAIN;
Review Comment:
Done.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] pkarashchenko commented on pull request #6529: net: Ensure sendmsg and sendfile return -EAGAIN in case of timeout
Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on PR #6529:
URL: https://github.com/apache/incubator-nuttx/pull/6529#issuecomment-1166993995
@xiaoxiang781216 please fix
```
tcp/tcp_send_unbuffered.c: In function 'psock_tcp_send':
Error: tcp/tcp_send_unbuffered.c:683:31: error: 'ETIMEOUT' undeclared (first use in this function); did you mean 'ETIMEDOUT'?
683 | if (ret == -ETIMEOUT)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] pkarashchenko merged pull request #6529: net: Ensure sendmsg and sendfile return -EAGAIN in case of timeout
Posted by GitBox <gi...@apache.org>.
pkarashchenko merged PR #6529:
URL: https://github.com/apache/incubator-nuttx/pull/6529
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org