ref: 260fd275dab89b56790cc14c7031236465ee6497
parent: 874beff560727f56160fb357576835318d07730c
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sun Oct 11 22:03:52 EDT 2020
ip/torrent: try harder allocating ports we used to only allocate ports from 6881 to 6890, which limits the maximum of parallel torrents to 9. this change make it go up to 9000, which gives us at best 2120 ports, which is overkill but ports might be randomly occupied by other connections.
--- a/sys/src/cmd/ip/torrent.c
+++ b/sys/src/cmd/ip/torrent.c
@@ -605,7 +605,7 @@
afd = -1;
nprocs = 0;
- for(port=6881; port<6890; port++){+ for(port=6881; port<9000; port++){snprint(addr, sizeof(addr), "tcp!*!%d", port);
if((afd = announce(addr, adir)) >= 0)
break;
--
⑨