Fix trcker command.

This commit is contained in:
rakshasa
2025-02-25 16:23:17 +01:00
committed by Jari Sundell
parent 4ac7313ff1
commit 80ef2e076d
2 changed files with 12 additions and 45 deletions
+7 -4
View File
@@ -74,12 +74,15 @@ apply_enable_trackers(int64_t arg) {
void
initialize_command_tracker() {
CMD2_TRACKER ("t.is_open", std::bind(&torrent::Tracker::is_busy, std::placeholders::_1));
CMD2_TRACKER ("t.is_enabled", std::bind(&torrent::Tracker::is_enabled, std::placeholders::_1));
CMD2_TRACKER ("t.is_usable", std::bind(&torrent::Tracker::is_usable, std::placeholders::_1));
CMD2_TRACKER ("t.is_busy", std::bind(&torrent::Tracker::is_busy, std::placeholders::_1));
CMD2_TRACKER ("t.is_enabled", std::bind(&torrent::Tracker::is_enabled, std::placeholders::_1));
CMD2_TRACKER ("t.is_extra_tracker", std::bind(&torrent::Tracker::is_extra_tracker, std::placeholders::_1));
CMD2_TRACKER ("t.can_scrape", std::bind(&torrent::Tracker::can_scrape, std::placeholders::_1));
CMD2_TRACKER ("t.is_open", std::bind(&torrent::Tracker::is_busy, std::placeholders::_1));
CMD2_TRACKER ("t.is_scrapable", std::bind(&torrent::Tracker::is_scrapable, std::placeholders::_1));
CMD2_TRACKER ("t.is_usable", std::bind(&torrent::Tracker::is_usable, std::placeholders::_1));
// TODO: Deprecate.
CMD2_TRACKER ("t.can_scrape", std::bind(&torrent::Tracker::is_scrapable, std::placeholders::_1));
CMD2_TRACKER_V ("t.enable", std::bind(&torrent::Tracker::enable, std::placeholders::_1));
CMD2_TRACKER_V ("t.disable", std::bind(&torrent::Tracker::disable, std::placeholders::_1));
+5 -41
View File
@@ -1,39 +1,3 @@
// rTorrent - BitTorrent client
// Copyright (C) 2005-2011, Jari Sundell
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// In addition, as a special exception, the copyright holders give
// permission to link the code of portions of this program with the
// OpenSSL library under certain conditions as described in each
// individual source file, and distribute linked combinations
// including the two.
//
// You must obey the GNU General Public License in all respects for
// all of the code used other than OpenSSL. If you modify file(s)
// with this exception, you may extend this exception to your version
// of the file(s), but you are not obligated to do so. If you do not
// wish to do so, delete this exception statement from your version.
// If you delete this exception statement from all source files in the
// program, then also delete it here.
//
// Contact: Jari Sundell <jaris@ifi.uio.no>
//
// Skomakerveien 33
// 3185 Skoppum, NORWAY
#include "config.h"
#define __STDC_FORMAT_MACROS
@@ -194,7 +158,7 @@ main(int argc, char** argv) {
torrent::log_initialize();
control = new Control;
unsigned int random_seed = cachedTime.seconds() ^ cachedTime.usec() ^ (getpid() << 16) ^ getppid();
srandom(random_seed);
@@ -268,7 +232,7 @@ main(int argc, char** argv) {
"method.insert = event.download.closed,multi|rlookup|static\n"
"method.insert = event.download.resumed,multi|rlookup|static\n"
"method.insert = event.download.paused,multi|rlookup|static\n"
"method.insert = event.download.finished,multi|rlookup|static\n"
"method.insert = event.download.hash_done,multi|rlookup|static\n"
"method.insert = event.download.hash_failed,multi|rlookup|static\n"
@@ -524,7 +488,7 @@ main(int argc, char** argv) {
}
void
handle_sigbus(int signum, siginfo_t* sa, void* ptr) {
handle_sigbus(int signum, siginfo_t* sa, [[maybe_unused]] void* ptr) {
if (signum != SIGBUS)
do_panic(signum);
@@ -604,7 +568,7 @@ do_panic(int signum) {
std::stringstream output;
output << "Caught " << SignalHandler::as_string(signum) << ", dumping stack:" << std::endl;
#ifdef HAVE_BACKTRACE
void* stackPtrs[20];
@@ -618,7 +582,7 @@ do_panic(int signum) {
#else
output << "Stack dump not enabled." << std::endl;
#endif
if (signum == SIGBUS)
output << "A bus error probably means you ran out of diskspace." << std::endl;