С announce.php
Код:
} else { if ($event == 'completed') { $snatch_updateset[] = "finished = 'yes'"; $snatch_updateset[] = "completedat = $dt"; $snatch_updateset[] = "seeder = 'yes'"; $updateset[] = 'times_completed = times_completed + 1'; } if (isset($self)) { $res=mysql_query('SELECT uploaded, downloaded FROM snatched WHERE torrent = '.$torrentid.' AND userid = '.$userid) or err(mysql_error()); $row = mysql_fetch_array($res); $downloaded2 = max(0, $downloaded - $self['downloaded']); $uploaded2 = max(0, $uploaded - $self['uploaded']); if ($downloaded2 > 0 || $uploaded2 > 0) { $snatch_updateset[] = "uploaded = uploaded + $uploaded2"; $snatch_updateset[] = "downloaded = downloaded + $downloaded2"; $snatch_updateset[] = "to_go = $left"; } $snatch_updateset[] = "port = $port"; $snatch_updateset[] = "last_action = $dt"; $snatch_updateset[] = "seeder = '$seeder'"; $prev_action = $self['last_action']; mysql_query("UPDATE LOW_PRIORITY peers SET uploaded = $uploaded, downloaded = $downloaded, uploadoffset = $uploaded2, downloadoffset = $downloaded2, to_go = $left, last_action = NOW(), prev_action = ".sqlesc($prev_action).", seeder = '$seeder'" . ($seeder == "yes" && $self["seeder"] != $seeder ? ", finishedat = " . time() : "") . ", agent = ".sqlesc($agent)." WHERE $selfwhere") or err('Tracker error 666');
Удаляяем следующие строки из кода выше:
Код:
$res=mysql_query('SELECT uploaded, downloaded FROM snatched WHERE torrent = '.$torrentid.' AND userid = '.$userid) or err(mysql_error()); $row = mysql_fetch_array($res);