Skip to content

onion-tunnel: don't close listening sockets immediately

eta requested to merge eta/no-auto-close into main
  • This fixes connections randomly dying sometimes: turns out this happened if you lost a race condition ("Arti trying to establish a Tor stream" versus "the smoltcp event loop completing the 3-way handshake").
    • This happens because the implementations of AsyncRead and AsyncWrite for the smoltcp sockets exit if s.may_recv() bzw. s.may_send() return false, which is true for sockets that aren't yet established.
  • To alleviate this problem, we count the LISTEN and SYN_RECEIVED TCP state machine states as states where we might be able to receive or send on the socket.

Closes #29 (closed).

Merge request reports