From 78f16cedd9d7c93befd2bdbd11b6f1f1843895b2 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sun, 18 Dec 2011 07:18:42 +0000 Subject: [PATCH] deprecate torrent::set_ratio --- ChangeLog | 1 + docs/manual.rst | 18 ------------------ examples/client_test.cpp | 18 +++--------------- include/libtorrent/torrent_handle.hpp | 8 ++++---- src/torrent_handle.cpp | 20 ++++++++++---------- 5 files changed, 18 insertions(+), 47 deletions(-) diff --git a/ChangeLog b/ChangeLog index d9deeaecb..2100ba82f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,4 @@ + * deprecate set_ratio() * add web seed support for torrents with pad files * introduced a more scalable API for torrent status updates (post_torrent_updates()) * updated the API to add_torrent_params turning all bools into flags of a flags field diff --git a/docs/manual.rst b/docs/manual.rst index ca26a21e8..f96f5fdea 100644 --- a/docs/manual.rst +++ b/docs/manual.rst @@ -2287,7 +2287,6 @@ Its declaration looks like this:: void remove_http_seed(std::string const& url); std::set http_seeds() const; - void set_ratio(float ratio) const; int max_uploads() const; void set_max_uploads(int max_uploads) const; void set_max_connections(int max_connections) const; @@ -2700,23 +2699,6 @@ case the torrent was started without metadata, and hasn't completely received it it returns the name given to it when added to the session. See ``session::add_torrent``. -set_ratio() ------------ - - :: - - void set_ratio(float ratio) const; - -``set_ratio()`` sets the desired download / upload ratio. If set to 0, it is considered being -infinite. i.e. the client will always upload as much as it can, no matter how much it gets back -in return. With this setting it will work much like the standard clients. - -Besides 0, the ratio can be set to any number greater than or equal to 1. It means how much to -attempt to upload in return for each download. e.g. if set to 2, the client will try to upload -2 bytes for every byte received. The default setting for this is 0, which will make it work -as a standard client. - - set_upload_limit() set_download_limit() upload_limit() download_limit() ----------------------------------------------------------------------- diff --git a/examples/client_test.cpp b/examples/client_test.cpp index c6e828523..9bd1f21f6 100644 --- a/examples/client_test.cpp +++ b/examples/client_test.cpp @@ -639,7 +639,6 @@ void print_peer_info(std::string& out, std::vector const& } int listen_port = 6881; -float preferred_ratio = 0.f; int allocation_mode = libtorrent::storage_mode_sparse; std::string save_path("."); int torrent_upload_limit = 0; @@ -664,7 +663,6 @@ void add_torrent(libtorrent::session& ses , handles_t& files , std::set& non_files , std::string const& torrent - , float preferred_ratio , int allocation_mode , std::string const& save_path , bool monitored_dir @@ -715,7 +713,6 @@ void add_torrent(libtorrent::session& ses h.set_max_connections(max_connections_per_torrent); h.set_max_uploads(-1); - h.set_ratio(preferred_ratio); h.set_upload_limit(torrent_upload_limit); h.set_download_limit(torrent_download_limit); h.use_interface(outgoing_interface.c_str()); @@ -728,7 +725,6 @@ void scan_dir(std::string const& dir_path , libtorrent::session& ses , handles_t& files , std::set& non_files - , float preferred_ratio , int allocation_mode , std::string const& save_path HTTP/1.1 200 OK Date: Wed, 23 Jul 2025 11:07:40 GMT Content-Type: text/plain; charset=utf-8 Connection: close Transfer-Encoding: chunked Cache-Control: max-age=0, private, must-revalidate, no-transform Set-Cookie: i_like_gitea=235e7b0591d69aba; Path=/; HttpOnly; Secure; SameSite=Lax Set-Cookie: _csrf=PMPKFSbsHgWR3esjO-1kPRnon2U6MTc1MzI2ODg2MDM5MTgyMzQ2Mw; Path=/; Max-Age=86400; HttpOnly; Secure; SameSite=Lax X-Frame-Options: SAMEORIGIN X-Cache-Status: HIT X-Cache-Age: 0 2226 From 78f16cedd9d7c93befd2bdbd11b6f1f1843895b2 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sun, 18 Dec 2011 07:18:42 +0000 Subject: [PATCH] deprecate torrent::set_ratio --- ChangeLog | 1 + docs/manual.rst | 18 ------------------ examples/client_test.cpp | 18 +++--------------- include/libtorrent/torrent_handle.hpp | 8 ++++---- src/torrent_handle.cpp | 20 ++++++++++---------- 5 files changed, 18 insertions(+), 47 deletions(-) diff --git a/ChangeLog b/ChangeLog index d9deeaecb..2100ba82f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,4 @@ + * deprecate set_ratio() * add web seed support for torrents with pad files * introduced a more scalable API for torrent status updates (post_torrent_updates()) * updated the API to add_torrent_params turning all bools into flags of a flags field diff --git a/docs/manual.rst b/docs/manual.rst index ca26a21e8..f96f5fdea 100644 --- a/docs/manual.rst +++ b/docs/manual.rst @@ -2287,7 +2287,6 @@ Its declaration looks like this:: void remove_http_seed(std::string const& url); std::set http_seeds() const; - void set_ratio(float ratio) const; int max_uploads() const; void set_max_uploads(int max_uploads) const; void set_max_connections(int max_connections) const; @@ -2700,23 +2699,6 @@ case the torrent was started without metadata, and hasn't completely received it it returns the name given to it when added to the session. See ``session::add_torrent``. -set_ratio() ------------ - - :: - - void set_ratio(float ratio) const; - -``set_ratio()`` sets the desired download / upload ratio. If set to 0, it is considered being -infinite. i.e. the client will always upload as much as it can, no matter how much it gets back -in return. With this setting it will work much like the standard clients. - -Besides 0, the ratio can be set to any number greater than or equal to 1. It means how much to -attempt to upload in return for each download. e.g. if set to 2, the client will try to upload -2 bytes for every byte received. The default setting for this is 0, which will make it work -as a standard client. - - set_upload_limit() set_download_limit() upload_limit() download_limit() ----------------------------------------------------------------------- diff --git a/examples/client_test.cpp b/examples/client_test.cpp index c6e828523..9bd1f21f6 100644 --- a/examples/client_test.cpp +++ b/examples/client_test.cpp @@ -639,7 +639,6 @@ void print_peer_info(std::string& out, std::vector const& } int listen_port = 6881; -float preferred_ratio = 0.f; int allocation_mode = libtorrent::storage_mode_sparse; std::string save_path("."); int torrent_upload_limit = 0; @@ -664,7 +663,6 @@ void add_torrent(libtorrent::session& ses , handles_t& files , std::set& non_files , std::string const& torrent - , float preferred_ratio , int allocation_mode , std::string const& save_path , bool monitored_dir @@ -715,7 +713,6 @@ void add_torrent(libtorrent::session& ses h.set_max_connections(max_connections_per_torrent); h.set_max_uploads(-1); - h.set_ratio(preferred_ratio); h.set_upload_limit(torrent_upload_limit); h.set_download_limit(torrent_download_limit); h.use_interface(outgoing_interface.c_str()); @@ -728,7 +725,6 @@ void scan_dir(std::string const& dir_path , libtorrent::session& ses , handles_t& files , std::set& non_files - , float preferred_ratio , int allocation_mode , std::string const& save_path 0