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 2021/04/05 16:58:54 UTC
[GitHub] [incubator-nuttx] v01d opened a new issue #3384: TCP ISSUES WITH QUICK CLOSE
v01d opened a new issue #3384:
URL: https://github.com/apache/incubator-nuttx/issues/3384
```
Description: This failure has been reported in the accept() logic:
- psock_tcp_accept() waits on net_lockedwait() below
- The accept operation completes, the socket is in the connected
state and psock_accept() is awakened. It cannot run,
however, because its priority is low and so it is blocked
from execution.
- In the mean time, the remote host sends a
packet which is presumably caught in the read-ahead buffer.
- Then the remote host closes the socket. Nothing happens on
the target side because net_start_monitor() has not yet been
called.
- Then accept() finally runs, but not with a connected but
rather with a disconnected socket. This fails when it
attempts to start the network monitor on the disconnected
socket below.
- It is also impossible to read the buffered TCP data from a
disconnected socket. The TCP recvfrom() logic would also
need to permit reading buffered data from a disconnected
socket.
This problem was report when the target hosted an FTP server
and files were being accessed by FileZilla.
connect() most likely has this same issue.
A work-around might be to raise the priority of the thread
that calls accept(). accept() might also need to check the
tcpstateflags in the connection structure before returning
in order to assure that the socket truly is connected.
Status: Open
Priority: Medium. I have never heard of this problem being reported
before, so I suspect it might not be so prevalent as one
might expect.
```
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org