Changes between Initial Version and Version 3 of Ticket #659

Nov 11, 2010, 5:22:51 PM (10 years ago)

Moving to the "unspecified" milestone. The real fix is a bit tricky. Here's our current behavior:

  1. For every listener that changed its port, open the new port.
  2. If they all succeeded, close the old sockets and assign the new sockets to the listeners.

Here is the complicated fix:

  1. Inventory all the ports we have.
  2. Figure out all the ports that we want and do not yet have
  3. Bind the ports that we want
  4. (assuming success) Assign every socket to the listener that it belongs to
  5. (assuming success) Close the sockets we aren't using any longer

Here is a more conservative "fix":

  1. When we get an EADDRINUSE, see whether we are already using the port for another listener. If so, tell the user that Tor doesn't support swapping ports around.

The fixes are made a bit more complicated because you can't do a simple equality check for "is this the same addr:port", since is special.

It would be cute to have a fix for this, but it's not hurting anybody now, and the workaround is pretty easy.


  • Ticket #659

    • Property Milestone changed from post 0.2.1.x to Tor: unspecified