New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Space Inventor: RDP fixes #88

Merged
merged 3 commits into from Mar 26, 2017

Conversation

Projects
None yet
2 participants
@johandc
Contributor

johandc commented Feb 7, 2017

Hi, please see the commit messages for each of the three commits.

johandc added some commits Oct 24, 2016

rdp: Open connections before receiving first packet
Previously we had to initiate a new RDP connection with a request containing a non-zero length packet. However, for streams this should not be necessary. So moving the conn-queue push to earlier will allow for a service to start transmitting as soon as somebody connects to the port.

Also i have removed the call to srand() since i feel this is something that is best done outside of the RDP stack. Furthermore it resulted in using the same sequence number if two connections were made within the same millisecond
bugfix: RDP do not close connection in CLOSE_WAIT
When the first RST is receive the rdp state is set to CLOSE_WAIT, and
the userspace is requested to close the connection by posting a null
pointer to the RX queue.

On the second RST message received, the connection is forcefully closed.
If the userspace task was still working on the RX queue, it will
therefore be denied the remainder of the received data.

This fix means that a connection that was already closed by the
userspace (on the first node to call csp_close()) and therefore put into
CLOSE_WAIT, will remain in CLOSE_WAIT untill the rdp timeout happens and
sliently sets the state to CLOSED.

This resolution is more in line with the original RDP specification
where connections were always left to just timeout in the CLOSE_WAIT
state.
rdp: Always send ack on syn/ack
We we relying on the userspace to send a packet in order to initiate
the transfer. This will not work with services that does not use a
request and relies on the fact that the connection is opened.

@johandc johandc changed the title from Multiple RDP fixes to Space Inventor: RDP fixes Feb 7, 2017

@jledet

jledet approved these changes Feb 21, 2017

Looks good to me.

@johandc johandc merged commit 17bbef3 into libcsp:master Mar 26, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment