* Some commands were not using the new "log.tracker" name. Ticket #1888.

* Fixed crash on empty bitfield in 'd.bitfield'.

* Fixes a file handle leak in the execute_capture functions. Patch by Josef Drexler.

* Moved ThreadBase to ./src as ./src/utils caused linker problems due to core::PollManager::create_poll_manager().


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1102 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2009-11-15 06:36:01 +00:00
parent 667c4c3562
commit 3359c2bbb0
10 changed files with 17 additions and 20 deletions
+3 -1
View File
@@ -38,6 +38,8 @@ rtorrent_SOURCES = \
option_parser.cc \
option_parser.h \
signal_handler.cc \
signal_handler.h
signal_handler.h \
thread_base.cc \
thread_base.h
INCLUDES = -I$(srcdir) -I$(top_srcdir)
+4 -1
View File
@@ -298,6 +298,9 @@ torrent::Object
retrieve_d_bitfield(core::Download* download) {
const torrent::Bitfield* bitField = download->download()->file_list()->bitfield();
if (bitField->empty())
return torrent::Object("");
return torrent::Object(rak::transform_hex(bitField->begin(), bitField->end()));
}
@@ -307,7 +310,7 @@ cmd_d_initialize_logs(core::Download* download) {
download->download()->signal_network_log(sigc::mem_fun(control->core(), &core::Manager::push_log_complete));
download->download()->signal_storage_error(sigc::mem_fun(control->core(), &core::Manager::push_log_complete));
if (!rpc::call_command_string("get_tracker_dump").empty())
if (!rpc::call_command_string("get_log.tracker").empty())
download->download()->signal_tracker_dump(sigc::ptr_fun(&core::receive_tracker_dump));
return torrent::Object();
+1 -1
View File
@@ -77,7 +77,7 @@ namespace core {
void
receive_tracker_dump(const std::string& url, const char* data, size_t size) {
const std::string& filename = rpc::call_command_string("get_tracker_dump");
const std::string& filename = rpc::call_command_string("get_log.tracker");
if (filename.empty())
return;
+2 -2
View File
@@ -42,5 +42,5 @@ rak::priority_queue_default taskScheduler;
rak::timer cachedTime;
Control* control = NULL;
//__thread utils::ThreadBase* this_thread = NULL;
utils::ThreadBase* this_thread = NULL;
//__thread ThreadBase* this_thread = NULL;
ThreadBase* this_thread = NULL;
+3 -3
View File
@@ -40,7 +40,7 @@
#include <rak/timer.h>
#include <rak/priority_queue_default.h>
#include "utils/thread_base.h"
#include "thread_base.h"
class Control;
@@ -53,7 +53,7 @@ extern rak::priority_queue_default taskScheduler;
extern rak::timer cachedTime;
extern Control* control;
// extern __thread utils::ThreadBase* this_thread; // Only use for worker threads for now.
extern utils::ThreadBase* this_thread; // Only use for main threads for now.
// extern __thread ThreadBase* this_thread; // Only use for worker threads for now.
extern ThreadBase* this_thread; // Only use for main threads for now.
#endif
+1 -1
View File
@@ -154,7 +154,7 @@ main(int argc, char** argv) {
control = new Control;
this_thread = new utils::ThreadBase();
this_thread = new ThreadBase();
this_thread->init_thread();
srandom(cachedTime.usec());
+2
View File
@@ -123,6 +123,8 @@ ExecFile::execute(const char* file, char* const* argv, int flags) {
m_capture += std::string(buffer, length);
} while (length > 0);
::close(pipeFd[0]);
if (m_logFd != -1) {
write(m_logFd, "Captured output:\n", sizeof("Captured output:\n"));
write(m_logFd, m_capture.data(), m_capture.length());
@@ -43,8 +43,6 @@
#include "globals.h"
namespace utils {
// Temporarly injected into config.h.
/* temp hack */
//#define __cacheline_aligned __attribute__((__aligned__(128)))
@@ -155,5 +153,3 @@ ThreadBase::init_thread() {
// ThreadBase::queue_item(thread_base_func newFunc) {
// m_threadQueue->push_back(newFunc);
// }
}
@@ -41,8 +41,6 @@
#include "rak/priority_queue_default.h"
#include "core/poll_manager.h"
namespace utils {
struct thread_queue_hack;
// Move this class to libtorrent.
@@ -82,6 +80,4 @@ private:
// thread_queue_hack* m_threadQueue;
};
}
#endif
+1 -3
View File
@@ -9,8 +9,6 @@ libsub_utils_a_SOURCES = \
lockfile.cc \
lockfile.h \
socket_fd.cc \
socket_fd.h \
thread_base.cc \
thread_base.h
socket_fd.h
INCLUDES = -I$(srcdir) -I$(srcdir)/.. -I$(top_srcdir)