whitelist/ban clients

Started by MrRep, May 15, 2011, 01:06:18 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Mindless

lol ah cool - i will update the array like soon as its on the list  :)

MrRep

thanks mindless, seems i have fixed it, i did try and comment out the code and got the same peer failure error. what i did was get a new announce from SVN, i did notice 1 change on it (dont know if it was me or not lol) it was missing define('TIME_NOW', time());

So thanks again, and dont work to hard :)

Mindless

#4
The reason its set up with those bans in place is down to peer id failures, incorrect stats reported, infohash fails amongst others and i cant tell you if its the source code that has the flaw or the clients with any certain degree of fact, If it was me i would comment out the code and just let any client be used or simply use the allowed clients like UT1850 ect the ones that are tried and tested and work but thats another story - The waste of resource banning or whitelisting is exactly that.. a waste of resource and thats my opinion, you'll need to wait a bit for me to do anything myself as im up to my aRse with the source code build itself among other things.

MrRep

#3
thanks mindless, i thought it was there, but i cant wok out what i need todo lol

is it banning all clients, and i have to whitelist, cos its default and its banned UT 1.6 and 2.2 and also rtorrent (clients i have tested).

Thanks again.

//edit

if i change the code to


$useragent = substr($peer_id, 1, 2);
$agentversion = substr($peer_id, 3, 4);
//===  make white list and ban others
if(($useragent == "UT" && $agentversion < 1800) || ($useragent == "AZ" && $agentversion >= 3000 || $useragent == "AZ" && $agentversion < 2500) || ($useragent == "UT" && $agentversion > 2300) || ($useragent == "T" && $agentversion < 0317) || ($useragent == "BC" && $agentversion < 0070) || ($useragent == "BS" && $agentversion < 0412) || ($useragent == "LH" && $agentversion < 3200) || ($useragent == "QB" && $agentversion < 1000) || ($useragent == "HL" && $agentversion < 0290))
err("$agent is banned. Please read the FAQ for a list of allowed clients!");

$white_list = array("AZ", "UT", "TO", "BC", "BS", "LH", "QB", "HL", "T", "03");
if (!in_array($useragent, $white_list))
err("$agent is banned. Please read the FAQ for a list of allowed clients!");


with only change on $useragent == "UT" && $agentversion > 2300) so that is accepting my 2.2, i get a peer fail error.

Mindless

announce.php :

$useragent = substr($peer_id, 1, 2);
$agentversion = substr($peer_id, 3, 4);
//===  make white list and ban others
if(($useragent == "UT" && $agentversion < 1800) || ($useragent == "AZ" && $agentversion >= 3000 || $useragent == "AZ" && $agentversion < 2500) || ($useragent == "UT" && $agentversion > 2000) || ($useragent == "T" && $agentversion < 0317) || ($useragent == "BC" && $agentversion < 0070) || ($useragent == "BS" && $agentversion < 0412) || ($useragent == "LH" && $agentversion < 3200) || ($useragent == "QB" && $agentversion < 1000) || ($useragent == "HL" && $agentversion < 0290))
err("$agent is banned. Please read the FAQ for a list of allowed clients!");

$white_list = array("AZ", "UT", "TO", "BC", "BS", "LH", "QB", "HL", "T", "03");
if (!in_array($useragent, $white_list))
err("$agent is banned. Please read the FAQ for a list of allowed clients!");

MrRep

Hi there, thanks for the great source, just 1 question, where do i set config of clients for whitelist/ban. as it seems to be deafult that all clients are banned. i have tested with ut 2.2 and rtorrent/libtorrent and both come back as banned. Im using memcache V2 btw.

Thanks all