Opened 6 years ago
Last modified 6 years ago
#5907 new Enhancement
Whitelist, takes precedence over blocklist
Reported by: | cfpp2p | Owned by: | jordan |
---|---|---|---|
Priority: | Normal | Milestone: | None Set |
Component: | libtransmission | Version: | 2.84 |
Severity: | Normal | Keywords: | |
Cc: |
Description
Place a file(s) with name ending as whitelist in your blocklist directory.
examples: b2-whitelist.txt A1-whitelist.p2p whitelist.dat
The file's data format must be same as what is currently allowed as per blocklist files. https://trac.transmissionbt.com/wiki/Blocklists
Whitelist will unblock specific peers.
The address or ranges in a whitelist will never be blocked even if in a blocklist. The whitelist always takes precedence over blocklist. It's easy to always allow single or multiple addresses or ranges now. The whitelist files are dealt with in all respects exactly as their counterpart blocklist files except the addresses of whitelist are always allowed no matter what.
-
session.c
old new 2432 2432 assert (tr_isSession (session)); 2433 2433 2434 2434 for (l = session->blocklists; l; l = l->next) 2435 if (tr_blocklistFileHasAddress (l->data, addr)) 2436 return true; 2435 { 2436 if (tr_stringEndsWith (tr_blocklistFileGetFilename (l->data), "whitelist.bin")) 2437 if (tr_blocklistFileHasAddress (l->data, addr)) 2438 return false; 2439 } 2440 for (l = session->blocklists; l; l = l->next) 2441 { 2442 if (!tr_stringEndsWith (tr_blocklistFileGetFilename (l->data), "whitelist.bin")) 2443 if (tr_blocklistFileHasAddress (l->data, addr)) 2444 return true; 2445 } 2437 2446 2438 2447 return false; 2439 2448 }
Patch: https://trac.transmissionbt.com/ticket/5923#comment:4
Info needs to be added to wiki.
https://trac.transmissionbt.com/wiki/Blocklists