Author Topic: Tracker problem possible reason  (Read 706 times)

numb3rs666

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Tracker problem possible reason
« on: March 04, 2018, 10:22:46 PM »
Hi at all, also with the last release a lot of trackers sent a error return message. I have working on my server a personal simple php tracker and also with my tracker I found the same problem. I have tried different torrent client and all work well, my tracker and other trackers.

This is the function to check if the client sent a string and in this case the tracker return an error message.
I have solved the problem with my tracker as follows:

/**
 * If you *really* don't want to, comment this line out.
 * Bencoding function, returns a bencoded dictionary.
 * You may go ahead and enter custom keys in the dictionary in this function if you'd like.
 */

function track($list, $interval = 60, $min_ival = 0)
{
    if (is_string($list)) { //Did we get a string? Return an error to the client
        //return 'd14:failure reason' . strlen($list) . ':' . $list . 'e'; with this line commented also Qbittorrent work correctly and the tracker result all working
    }

    $p = ''; //Peer directory
    $c = $i = 0; //Complete and Incomplete clients

    foreach ($list as $d) { //Runs for each client
        if ($d[7]) { //Are we seeding?
            $c++; //Seeding, add to complete list
            if (__NO_SEED_P2P && is_seed()) { //Seeds should not see each others
                continue;
            }
        } else {
            $i++; //Not seeding, add to incomplete list
        }

        //Do some bencoding
        $pid = '';

        if (isset($_GET['no_peer_id']) === false && __NO_PEER_ID) { //Shall we include the peer id
            $pid = '7:peer id' . strlen($d[1]) . ':' . $d[1];
        }

        $p .= 'd2:ip' . strlen($d[0]) . ':' . $d[0] . $pid . '4:porti' . $d[2] . 'ee';
    }

    //Add some other paramters in the dictionary and merge with peer list
    $r = 'd8:intervali' . $interval . 'e12:min intervali' . $min_ival . 'e8:completei' . $c . 'e10:incompletei' . $i . 'e5:peersl' . $p . 'ee';

    return $r;
}


Could you please explain which is the reason I am not  an expert.

Thanks a lot for your work  :)
« Last Edit: March 05, 2018, 09:09:29 AM by numb3rs666 »