Skip to content
Snippets Groups Projects
Commit bc594455 authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Perform super-graceful shutdown of the socket on success.

This should guard against a RST being sent on success.  It's possible
that the remote has sent data (ie: M_EOB) we would recv() after we
commit to ending the session.  If the script terminates while there
is data to be read, this would result in sending a RST.

To prevent this, we call shutdown(sock, SHUT_WR) via setting is_writeable
to false (because that's how we roll), then recv() all data until the
remote closes the session, or the timeout passes.
parent 76a9cc99
Branches
Tags
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment