micahflee/onionshare — pull request #15 by enotodden (2014-05-24 21:51:47+00:00)
Title: Let the OS select an unused port instead of using a random integer.

This patch replaces the randint() call (for selecting a port number) with the 'port 0 trick' to make the OS select a free port, avoiding port-number collisions.

randint(1025, 65535) is nice and quick, but it's annoying if it returns a port that's already in use.