mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-10-22 09:06:18 +00:00
* Added better logging facilities.
* Changed tracker retry timers. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1192 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
+3
-7
@@ -176,13 +176,9 @@ AC_DEFUN([TORRENT_CHECK_FALLOCATE], [
|
|||||||
AC_DEFUN([TORRENT_CHECK_POSIX_FALLOCATE], [
|
AC_DEFUN([TORRENT_CHECK_POSIX_FALLOCATE], [
|
||||||
AC_MSG_CHECKING(for posix_fallocate)
|
AC_MSG_CHECKING(for posix_fallocate)
|
||||||
|
|
||||||
AC_COMPILE_IFELSE(
|
AC_TRY_LINK([#include <fcntl.h>
|
||||||
[[#include <fcntl.h>
|
],[ posix_fallocate(0, 0, 0);
|
||||||
int main() {
|
],
|
||||||
posix_fallocate(0, 0, 0);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
]],
|
|
||||||
[
|
[
|
||||||
AC_DEFINE(USE_POSIX_FALLOCATE, 1, posix_fallocate supported.)
|
AC_DEFINE(USE_POSIX_FALLOCATE, 1, posix_fallocate supported.)
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
|
|||||||
@@ -45,6 +45,7 @@
|
|||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <torrent/torrent.h>
|
#include <torrent/torrent.h>
|
||||||
#include <torrent/chunk_manager.h>
|
#include <torrent/chunk_manager.h>
|
||||||
|
#include <torrent/log_files.h>
|
||||||
#include <torrent/data/file_manager.h>
|
#include <torrent/data/file_manager.h>
|
||||||
#include <torrent/data/chunk_utils.h>
|
#include <torrent/data/chunk_utils.h>
|
||||||
|
|
||||||
@@ -100,6 +101,27 @@ apply_log(const torrent::Object::string_type& arg, int logType) {
|
|||||||
return torrent::Object();
|
return torrent::Object();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
torrent::Object
|
||||||
|
apply_log_libtorrent(const torrent::Object::list_type& args) {
|
||||||
|
if (args.empty() || args.size() > 2)
|
||||||
|
throw torrent::input_error("Invalid argument count.");
|
||||||
|
|
||||||
|
torrent::log_file* log_file = torrent::find_log_file(args.front().as_string().c_str());
|
||||||
|
|
||||||
|
if (log_file == NULL)
|
||||||
|
throw torrent::input_error("Invalid log name.");
|
||||||
|
|
||||||
|
if (args.size() == 1) {
|
||||||
|
log_file->close();
|
||||||
|
return torrent::Object();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!log_file->open_file(args.back().as_string().c_str()))
|
||||||
|
throw torrent::input_error("Could not open log file.");
|
||||||
|
|
||||||
|
return torrent::Object();
|
||||||
|
}
|
||||||
|
|
||||||
torrent::Object
|
torrent::Object
|
||||||
system_hostname() {
|
system_hostname() {
|
||||||
char buffer[1024];
|
char buffer[1024];
|
||||||
@@ -301,6 +323,8 @@ initialize_command_local() {
|
|||||||
CMD2_ANY_STRING ("log.vmmap.dump", std::tr1::bind(&log_vmmap_dump, std::tr1::placeholders::_2));
|
CMD2_ANY_STRING ("log.vmmap.dump", std::tr1::bind(&log_vmmap_dump, std::tr1::placeholders::_2));
|
||||||
CMD2_ANY_STRING_V("log.xmlrpc", std::tr1::bind(&ThreadWorker::set_xmlrpc_log, worker_thread, std::tr1::placeholders::_2));
|
CMD2_ANY_STRING_V("log.xmlrpc", std::tr1::bind(&ThreadWorker::set_xmlrpc_log, worker_thread, std::tr1::placeholders::_2));
|
||||||
|
|
||||||
|
CMD2_ANY_LIST ("log.libtorrent", std::tr1::bind(&apply_log_libtorrent, std::tr1::placeholders::_2));
|
||||||
|
|
||||||
// TODO: Convert to new command types:
|
// TODO: Convert to new command types:
|
||||||
*rpc::command_base::argument(0) = "placeholder.0";
|
*rpc::command_base::argument(0) = "placeholder.0";
|
||||||
*rpc::command_base::argument(1) = "placeholder.1";
|
*rpc::command_base::argument(1) = "placeholder.1";
|
||||||
|
|||||||
Reference in New Issue
Block a user