External bencode library and some other changes.

This commit is contained in:
Yuriy Pikhtarev 2017-05-26 02:21:46 +03:00
commit bb6f772627
No known key found for this signature in database
GPG key ID: 3A9B5A757B48ECC6
10 changed files with 137 additions and 85 deletions

View file

@ -50,11 +50,11 @@ function msg_die($msg)
dbg_log(' ', '!die-' . clean_filename($msg));
}
$output = bencode(array(
$output = \Rych\Bencode\Bencode::encode([
'min interval' => (int)1800,
'failure reason' => (string)$msg,
'warning message' => (string)$msg,
));
]);
die($output);
}
@ -77,7 +77,7 @@ $output['files'][$info_hash] = array(
'incomplete' => (int)$row['leechers'],
);
echo bencode($output);
echo \Rych\Bencode\Bencode::encode($output);
tracker_exit();
exit;