added tracker failure check
This commit is contained in:
parent
aeda1d2718
commit
da82b6829a
1 changed files with 4 additions and 0 deletions
|
|
@ -57,6 +57,10 @@ class Tracker {
|
|||
}
|
||||
|
||||
$response = bdecode($result);
|
||||
if (array_key_exists($response, "failure reason")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$peersEnc = $response["peers"];
|
||||
for ($i = 0; $i < strlen($peersEnc); $i+=6) {
|
||||
$remoteIp = long2ip(unpack("N", $peersEnc, $i)[1]);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue