From 601f8c04765b2235a65dfe80586440f6d52839c6 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sat, 29 Nov 2014 09:12:44 +0000 Subject: [PATCH] merged changes from RC_1_0 --- docs/reference-Session.html | 2 +- docs/stats_counters.rst | 157 +++++++++++++++++++++++---- docs/todo.html | 28 +++-- include/libtorrent/bencode.hpp | 5 +- include/libtorrent/entry.hpp | 1 + include/libtorrent/socks5_stream.hpp | 2 + include/libtorrent/storage.hpp | 1 + include/libtorrent/upnp.hpp | 1 + src/torrent_info.cpp | 2 + 9 files changed, 166 insertions(+), 33 deletions(-) diff --git a/docs/reference-Session.html b/docs/reference-Session.html index e66e33d30..489385d02 100644 --- a/docs/reference-Session.html +++ b/docs/reference-Session.html @@ -3,7 +3,7 @@ - + Session diff --git a/docs/stats_counters.rst b/docs/stats_counters.rst index b6c51da75..d473deba5 100644 --- a/docs/stats_counters.rst +++ b/docs/stats_counters.rst @@ -1099,6 +1099,8 @@ triggered it .. _disk.queued_disk_jobs: +.. _disk.num_running_disk_jobs: + .. _disk.num_read_jobs: .. _disk.num_write_jobs: @@ -1117,6 +1119,7 @@ triggered it + @@ -1124,29 +1127,31 @@ triggered it -+--------------------------+-------+ -| name | type | -+==========================+=======+ -| disk.request_latency | gauge | -+--------------------------+-------+ -| disk.pinned_blocks | gauge | -+--------------------------+-------+ -| disk.disk_blocks_in_use | gauge | -+--------------------------+-------+ -| disk.queued_disk_jobs | gauge | -+--------------------------+-------+ -| disk.num_read_jobs | gauge | -+--------------------------+-------+ -| disk.num_write_jobs | gauge | -+--------------------------+-------+ -| disk.num_jobs | gauge | -+--------------------------+-------+ -| disk.num_writing_threads | gauge | -+--------------------------+-------+ -| disk.num_running_threads | gauge | -+--------------------------+-------+ -| disk.blocked_disk_jobs | gauge | -+--------------------------+-------+ ++----------------------------+-------+ +| name | type | ++============================+=======+ +| disk.request_latency | gauge | ++----------------------------+-------+ +| disk.pinned_blocks | gauge | ++----------------------------+-------+ +| disk.disk_blocks_in_use | gauge | ++----------------------------+-------+ +| disk.queued_disk_jobs | gauge | ++----------------------------+-------+ +| disk.num_running_disk_jobs | gauge | ++----------------------------+-------+ +| disk.num_read_jobs | gauge | ++----------------------------+-------+ +| disk.num_write_jobs | gauge | ++----------------------------+-------+ +| disk.num_jobs | gauge | ++----------------------------+-------+ +| disk.num_writing_threads | gauge | ++----------------------------+-------+ +| disk.num_running_threads | gauge | ++----------------------------+-------+ +| disk.blocked_disk_jobs | gauge | ++----------------------------+-------+ the number of microseconds it takes from receiving a request from a @@ -1321,6 +1326,112 @@ hash a piece (when verifying against the piece hash) cumulative time spent in various disk jobs, as well as total for all disk jobs. Measured in microseconds +.. _disk.num_fenced_read: + +.. _disk.num_fenced_write: + +.. _disk.num_fenced_hash: + +.. _disk.num_fenced_move_storage: + +.. _disk.num_fenced_release_files: + +.. _disk.num_fenced_delete_files: + +.. _disk.num_fenced_check_fastresume: + +.. _disk.num_fenced_save_resume_data: + +.. _disk.num_fenced_rename_file: + +.. _disk.num_fenced_stop_torrent: + +.. _disk.num_fenced_cache_piece: + +.. _disk.num_fenced_flush_piece: + +.. _disk.num_fenced_flush_hashed: + +.. _disk.num_fenced_flush_storage: + +.. _disk.num_fenced_trim_cache: + +.. _disk.num_fenced_file_priority: + +.. _disk.num_fenced_load_torrent: + +.. _disk.num_fenced_clear_piece: + +.. _disk.num_fenced_tick_storage: + +.. raw:: html + + + + + + + + + + + + + + + + + + + + + ++----------------------------------+-------+ +| name | type | ++==================================+=======+ +| disk.num_fenced_read | gauge | ++----------------------------------+-------+ +| disk.num_fenced_write | gauge | ++----------------------------------+-------+ +| disk.num_fenced_hash | gauge | ++----------------------------------+-------+ +| disk.num_fenced_move_storage | gauge | ++----------------------------------+-------+ +| disk.num_fenced_release_files | gauge | ++----------------------------------+-------+ +| disk.num_fenced_delete_files | gauge | ++----------------------------------+-------+ +| disk.num_fenced_check_fastresume | gauge | ++----------------------------------+-------+ +| disk.num_fenced_save_resume_data | gauge | ++----------------------------------+-------+ +| disk.num_fenced_rename_file | gauge | ++----------------------------------+-------+ +| disk.num_fenced_stop_torrent | gauge | ++----------------------------------+-------+ +| disk.num_fenced_cache_piece | gauge | ++----------------------------------+-------+ +| disk.num_fenced_flush_piece | gauge | ++----------------------------------+-------+ +| disk.num_fenced_flush_hashed | gauge | ++----------------------------------+-------+ +| disk.num_fenced_flush_storage | gauge | ++----------------------------------+-------+ +| disk.num_fenced_trim_cache | gauge | ++----------------------------------+-------+ +| disk.num_fenced_file_priority | gauge | ++----------------------------------+-------+ +| disk.num_fenced_load_torrent | gauge | ++----------------------------------+-------+ +| disk.num_fenced_clear_piece | gauge | ++----------------------------------+-------+ +| disk.num_fenced_tick_storage | gauge | ++----------------------------------+-------+ + + +for each kind of disk job, a counter of how many jobs of that kind +are currently blocked by a disk fence + .. _dht.dht_nodes: .. raw:: html diff --git a/docs/todo.html b/docs/todo.html index 0ac881a14..13dc8b54c 100644 --- a/docs/todo.html +++ b/docs/todo.html @@ -1771,19 +1771,21 @@ are missing in the bucket

../src/kademlia/node.cpp:486

	node_id mask = generate_prefix_mask(bucket + 1);
 	node_id target = generate_secret_id() & ~mask;
@@ -6632,7 +6634,13 @@ put completes

../src/kademlia/dht_tracker.cpp:430

../src/kademlia/dht_tracker.cpp:430

relevance 0../include/libtorrent/peer_connection.hpp:725make this private

make this private

../include/libtorrent/peer_connection.hpp:725

		void set_soft_packet_size(int size) { m_soft_packet_size = size; }
 
 // internal
 
relevance 0../include/libtorrent/debug.hpp:215rewrite this class to use FILE* instead and have a printf-like interface

rewrite this class to use FILE* instead and @@ -7421,6 +7432,7 @@ namespace libtorrent TORRENT_EXPORT boost::system::error_code make_error_code(error_code_enum e); } + // the boost.system error category for UPnP errors TORRENT_EXPORT boost::system::error_category& get_upnp_category(); // int: port-mapping index diff --git a/include/libtorrent/bencode.hpp b/include/libtorrent/bencode.hpp index d8f57e13c..af2a3c66e 100644 --- a/include/libtorrent/bencode.hpp +++ b/include/libtorrent/bencode.hpp @@ -102,12 +102,15 @@ POSSIBILITY OF SUCH DAMAGE. namespace libtorrent { +#ifndef TORRENT_NO_DEPRECATE // thrown by bdecode() if the provided bencoded buffer does not contain // valid encoding. struct TORRENT_EXPORT invalid_encoding: std::exception { + // hidden virtual const char* what() const throw() { return "invalid bencoding"; } }; +#endif namespace detail { @@ -429,7 +432,7 @@ namespace libtorrent // Now we just need to know how to retrieve information from the entry. // // If ``bdecode()`` encounters invalid encoded data in the range given to it - // it will throw libtorrent_exception. + // it will return a default constructed ``entry`` object. template int bencode(OutIt out, const entry& e) { return detail::bencode_recursive(out, e); diff --git a/include/libtorrent/entry.hpp b/include/libtorrent/entry.hpp index edf7ce37d..1b3a17d23 100644 --- a/include/libtorrent/entry.hpp +++ b/include/libtorrent/entry.hpp @@ -83,6 +83,7 @@ namespace libtorrent // of the entry object. struct TORRENT_EXPORT type_error: std::runtime_error { + // internal type_error(const char* error): std::runtime_error(error) {} }; diff --git a/include/libtorrent/socks5_stream.hpp b/include/libtorrent/socks5_stream.hpp index b1cd19b0c..32cb12dd2 100644 --- a/include/libtorrent/socks5_stream.hpp +++ b/include/libtorrent/socks5_stream.hpp @@ -64,7 +64,9 @@ namespace socks_error { num_errors }; + // internal TORRENT_EXPORT boost::system::error_code make_error_code(socks_error_code e); + } // namespace socks_error // returns the error_category for SOCKS5 errors diff --git a/include/libtorrent/storage.hpp b/include/libtorrent/storage.hpp index 7e1c05056..d5e72101c 100644 --- a/include/libtorrent/storage.hpp +++ b/include/libtorrent/storage.hpp @@ -408,6 +408,7 @@ namespace libtorrent // hidden ~default_storage(); + // hidden void set_file_priority(std::vector const& prio); #ifndef TORRENT_NO_DEPRECATE void finalize_file(int file, storage_error& ec); diff --git a/include/libtorrent/upnp.hpp b/include/libtorrent/upnp.hpp index a38542f07..727927a0d 100644 --- a/include/libtorrent/upnp.hpp +++ b/include/libtorrent/upnp.hpp @@ -97,6 +97,7 @@ namespace libtorrent TORRENT_EXPORT boost::system::error_code make_error_code(error_code_enum e); } + // the boost.system error category for UPnP errors TORRENT_EXPORT boost::system::error_category& get_upnp_category(); // int: port-mapping index diff --git a/src/torrent_info.cpp b/src/torrent_info.cpp index 34854192e..feb35b947 100644 --- a/src/torrent_info.cpp +++ b/src/torrent_info.cpp @@ -93,6 +93,8 @@ namespace libtorrent // in paths TORRENT_EXTRA_EXPORT bool verify_encoding(std::string& target, bool fix_paths = false) { + if (target.empty()) return true; + std::string tmp_path; tmp_path.reserve(target.size()+5); bool valid_encoding = true;