diff --git a/Jamfile b/Jamfile index d42a31f50..4466f1ae1 100644 --- a/Jamfile +++ b/Jamfile @@ -27,15 +27,11 @@ if $(BOOST_ROOT) else { local boost-lib-search-path = - /opt/local/lib /usr/lib /usr/local/lib - /sw/lib - /usr/g++/lib ; local boost-include-path = - /opt/local/include /usr/local/include /usr/sfw/include ; @@ -125,11 +121,6 @@ rule linking ( properties * ) # gcrypt libraries, if enabled if libgcrypt in $(properties) { - # on mac os x, adding the /opt/local/include path - # would include openssl headers incompatible with - # the system library. Only add this include path - # if we're not using openssl (which we're most - # likely not if we're using libgcrypt) result += gcrypt ; } @@ -556,10 +547,10 @@ lib gcc : : gcc static ; lib libiconv : : iconv shared /usr/local/lib ; # openssl on linux/bsd/macos etc. -lib gcrypt : : gcrypt shared /opt/local/lib /usr/local/lib : : /opt/local/include /usr/local/include ; +lib gcrypt : : gcrypt shared /usr/local/lib : : /usr/local/include ; lib z : : shared z /usr/lib ; -lib crypto : : crypto shared z /opt/local/lib : : /opt/local/include ; -lib ssl : : ssl shared crypto /opt/local/lib : : /opt/local/include ; +lib crypto : : crypto shared z ; +lib ssl : : ssl shared crypto ; lib dl : : shared dl ; # time functions used on linux require librt @@ -601,7 +592,6 @@ SOURCES = entry error_code file_storage - lazy_bdecode escape_string string_util file @@ -770,6 +760,7 @@ lib torrent on:src/kademlia/$(KADEMLIA_SOURCES).cpp on:ed25519/src/$(ED25519_SOURCES).cpp on:src/hasher512.cpp + on:src/lazy_bdecode.cpp debug:on debug:on diff --git a/include/libtorrent/add_torrent_params.hpp b/include/libtorrent/add_torrent_params.hpp index fe6101183..d56279786 100644 --- a/include/libtorrent/add_torrent_params.hpp +++ b/include/libtorrent/add_torrent_params.hpp @@ -39,7 +39,7 @@ POSSIBILITY OF SUCH DAMAGE. #include #include "libtorrent/storage_defs.hpp" -#include "libtorrent/peer_id.hpp" // sha1_hash +#include "libtorrent/sha1_hash.hpp" #include "libtorrent/version.hpp" #include "libtorrent/socket.hpp" // for tcp::endpoint #include "libtorrent/bitfield.hpp" @@ -457,7 +457,7 @@ namespace libtorrent std::map renamed_files; #ifndef TORRENT_NO_DEPRECATE - // deprecated in 1.2 + // deprecated in 1.2 // if ``uuid`` is specified, it is used to find duplicates. If another // torrent is already running with the same UUID as the one being added, // it will be considered a duplicate. This is mainly useful for RSS feed diff --git a/include/libtorrent/disk_io_thread_pool.hpp b/include/libtorrent/disk_io_thread_pool.hpp index 0ed76a21a..5679a2068 100644 --- a/include/libtorrent/disk_io_thread_pool.hpp +++ b/include/libtorrent/disk_io_thread_pool.hpp @@ -42,7 +42,6 @@ POSSIBILITY OF SUCH DAMAGE. #include #include #include -#include namespace libtorrent { @@ -77,7 +76,7 @@ namespace libtorrent // it is expected that they will be called while holding the // job queue mutex - // theese functions should be called by the thread_fun to signal its state + // these functions should be called by the thread_fun to signal its state // threads are considered active when they are started so thread_idle should // be called first // these calls are not thread safe @@ -97,7 +96,7 @@ namespace libtorrent // get the thread id of the first thread in the internal vector // since this is the first thread it will remain the same until the first // thread exits - // it can be used to trigger maintainance jobs which should only run on one thread + // it can be used to trigger maintenance jobs which should only run on one thread std::thread::id first_thread_id(); int num_threads() { diff --git a/src/disk_io_thread_pool.cpp b/src/disk_io_thread_pool.cpp index fdb4438f2..76e0d61de 100644 --- a/src/disk_io_thread_pool.cpp +++ b/src/disk_io_thread_pool.cpp @@ -31,8 +31,9 @@ POSSIBILITY OF SUCH DAMAGE. */ #include "libtorrent/disk_io_thread_pool.hpp" -#include "libtorrent/disk_io_thread.hpp" -#include +#include "libtorrent/assert.hpp" + +#include namespace { @@ -79,7 +80,7 @@ namespace libtorrent if (wait) { // must release m_mutex to avoid a deadlock if the thread - // tries to aquire it + // tries to acquire it l.unlock(); t.join(); l.lock(); @@ -138,7 +139,7 @@ namespace libtorrent void disk_io_thread_pool::job_queued(int queue_size) { // this check is not strictly necessary - // but do it to avoid aquiring the mutex in the trivial case + // but do it to avoid acquiring the mutex in the trivial case if (m_num_idle_threads >= queue_size) return; std::lock_guard l(m_mutex); if (m_abort) return; diff --git a/src/session_impl.cpp b/src/session_impl.cpp index 51115265e..045cd1448 100644 --- a/src/session_impl.cpp +++ b/src/session_impl.cpp @@ -174,7 +174,6 @@ namespace #include #endif -using libtorrent::aux::session_impl; using namespace std::placeholders; #ifdef BOOST_NO_EXCEPTIONS @@ -5156,10 +5155,9 @@ namespace aux { void session_impl::update_count_slow() { error_code ec; - for (torrent_map::const_iterator i = m_torrents.begin() - , end(m_torrents.end()); i != end; ++i) + for (auto const& tp : m_torrents) { - i->second->on_inactivity_tick(ec); + tp.second->on_inactivity_tick(ec); } } @@ -5173,7 +5171,7 @@ namespace aux { // if not, don't tell the tracker anything if we're in force_proxy // mode. We don't want to leak our listen port since it can - // potentially identify us if it is leaked elsewere + // potentially identify us if it is leaked elsewhere if (m_settings.get_bool(settings_pack::force_proxy)) return 0; if (m_listen_sockets.empty()) return 0; return m_listen_sockets.front().tcp_external_port; @@ -5192,12 +5190,11 @@ namespace aux { // if not, don't tell the tracker anything if we're in force_proxy // mode. We don't want to leak our listen port since it can - // potentially identify us if it is leaked elsewere + // potentially identify us if it is leaked elsewhere if (m_settings.get_bool(settings_pack::force_proxy)) return 0; - for (std::list::const_iterator i = m_listen_sockets.begin() - , end(m_listen_sockets.end()); i != end; ++i) + for (auto const& s : m_listen_sockets) { - if (i->ssl) return i->tcp_external_port; + if (s.ssl) return s.tcp_external_port; } #endif return 0; diff --git a/src/torrent.cpp b/src/torrent.cpp index e9fada786..85ee6592c 100644 --- a/src/torrent.cpp +++ b/src/torrent.cpp @@ -101,7 +101,6 @@ POSSIBILITY OF SUCH DAMAGE. #include "libtorrent/aux_/session_impl.hpp" // for tracker_logger #endif -using namespace libtorrent; using namespace std::placeholders; namespace libtorrent