Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions mysql/announce.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,21 @@
{
// dotted decimal only
$_GET['ip'] = trim($_GET['ip'],'::ffff:');
if (!ip2long($_GET['ip'])) tracker_error('invalid ip, dotted decimal only');
if (!ip2long($_GET['ip'])) {
unset($_GET['ip']);
//tracker_error('invalid ip, dotted decimal only');
}
}
if (!isset($_GET['ip']))
{
// set ip to connected client
if (isset($_SERVER['REMOTE_ADDR'])) {
$_GET['ip'] = trim($_SERVER['REMOTE_ADDR'],'::ffff:');
} else {
// cannot locate suitable ip, must abort
tracker_error('could not locate clients ip');
}
}
// set ip to connected client
elseif (isset($_SERVER['REMOTE_ADDR'])) $_GET['ip'] = trim($_SERVER['REMOTE_ADDR'],'::ffff:');
// cannot locate suitable ip, must abort
else tracker_error('could not locate clients ip');

// integer - numwant - optional
// number of peers that the client has requested
Expand Down Expand Up @@ -108,4 +117,4 @@
// close database
peertracker::close();

?>
?>