From 85f5b7dc46bccc53e961670e46affb4f19b3f55d Mon Sep 17 00:00:00 2001 From: rakshasa Date: Tue, 7 Oct 2008 13:14:59 +0000 Subject: [PATCH] * Fixed two instances of string includes where was used instead of . * Fixes {stop,close}_on_ratio calling further commands even when the "ignore commands" flag is set. * Work-around for OpenBSD's broken sys/event.h, which fails to compile if it's the first (or only) included header. (Ticket #1470) * Fixes compilation with old libcurl versions. (Ticket #1471) * Fix compile error on systems that lack mincore(2). * Fixes a crash in epoll due to libcurl/c-ares bug: PollEPoll::modify(...) epoll_ctl call failed. All patches by Josef Drexler. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1072 e378c898-3ddf-0310-93e7-cc216c733640 --- src/command_events.cc | 3 +++ src/core/curl_stack.cc | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/command_events.cc b/src/command_events.cc index 937b336c..0ab26143 100644 --- a/src/command_events.cc +++ b/src/command_events.cc @@ -114,6 +114,9 @@ apply_on_ratio(int action, const torrent::Object& rawArgs) { (itr = std::find_if(itr, downloadList->end(), std::mem_fun(&core::Download::is_seeding))) != downloadList->end(); ) { core::Download* current = *itr++; + if (rpc::call_command_value("d.get_ignore_commands", rpc::make_target(current)) != 0) + continue; + int64_t totalDone = current->download()->bytes_done(); int64_t totalUpload = current->download()->up_rate()->total(); diff --git a/src/core/curl_stack.cc b/src/core/curl_stack.cc index a4bc212a..de2c5bd6 100644 --- a/src/core/curl_stack.cc +++ b/src/core/curl_stack.cc @@ -55,11 +55,11 @@ CurlStack::CurlStack() : m_taskTimeout.set_slot(rak::mem_fn(this, &CurlStack::receive_timeout)); - curl_multi_setopt((CURLM*)m_handle, CURLMOPT_TIMERDATA, this); - curl_multi_setopt((CURLM*)m_handle, CURLMOPT_SOCKETDATA, this); #if (LIBCURL_VERSION_NUM >= 0x071000) + curl_multi_setopt((CURLM*)m_handle, CURLMOPT_TIMERDATA, this); curl_multi_setopt((CURLM*)m_handle, CURLMOPT_TIMERFUNCTION, &CurlStack::set_timeout); #endif + curl_multi_setopt((CURLM*)m_handle, CURLMOPT_SOCKETDATA, this); curl_multi_setopt((CURLM*)m_handle, CURLMOPT_SOCKETFUNCTION, &CurlSocket::receive_socket); }