} if (isset($_SERVER['HTTP_REFERER'])) { $str[] = $_SERVER['HTTP_REFERER']; } if (!empty($_POST) && $add_post) { $str[] = "post: " . str_compact(urldecode(http_build_query($_POST))); } $str = join("\t", $str) . "\n"; bb_log($str, $file); } // Board init if (defined('IN_FORUM')) { require INC_DIR . 'init_bb.php'; } else { if (defined('IN_TRACKER')) { define('DUMMY_PEER', pack('Nn', ip2long($_SERVER['REMOTE_ADDR']), !empty($_GET['port']) ? intval($_GET['port']) : mt_rand(1000, 65000))); function dummy_exit($interval = 1800) { $output = bencode(array('interval' => (int) $interval, 'min interval' => (int) $interval, 'peers' => (string) DUMMY_PEER)); die($output); } header('Content-Type: text/plain'); header('Pragma: no-cache'); if (!defined('IN_ADMIN')) { // Exit if tracker is disabled via ON/OFF trigger if (file_exists(BB_DISABLED)) { dummy_exit(mt_rand(60, 2400)); } } } }
/** * Open connection */ function connect() { $this->cur_query = 'connect'; $this->debug('start'); $connect_type = $this->cfg['persist'] ? 'mysql_pconnect' : 'mysql_connect'; if (!($link = $connect_type($this->cfg['dbhost'], $this->cfg['dbuser'], $this->cfg['dbpasswd']))) { $this->log_error(); } register_shutdown_function(array(&$this, 'close')); $this->debug('end'); $this->cur_query = null; # if (DBG_LOG) dbg_log(' ', 'DB-connect'. ($link ? '' : '-FAIL')); if (!$link) { if (function_exists('dummy_exit')) { dummy_exit(mt_rand(1200, 2400)); } else { die; } } return $link; }
function drop_fast_announce($lp_info) { global $announce_interval; if ($lp_info['update_time'] < TIMENOW - $announce_interval + 60) { return; // if announce interval correct } $new_ann_intrv = $lp_info['update_time'] + $announce_interval - TIMENOW; dummy_exit($new_ann_intrv); }