diff --git a/docs/manual.html b/docs/manual.html
index ef1748e00..c7e43cb25 100644
--- a/docs/manual.html
+++ b/docs/manual.html
@@ -92,7 +92,7 @@
-
+
void set_sequential_download(bool sd);
+bool is_sequential_download() const;
-
Enables or disables sequential download. When enabled, the piece picker will pick pieces in sequence
-instead of rarest first.
+
set_sequential_download() enables or disables sequential download. When enabled, the piece
+picker will pick pieces in sequence instead of rarest first.
Enabling sequential download will affect the piece distribution negatively in the swarm. It should be
used sparingly.
+
is_sequential_download() returns true if this torrent is downloading in sequence, and false
+otherwise.
diff --git a/docs/manual.rst b/docs/manual.rst
index c9537554c..f6e02006e 100644
--- a/docs/manual.rst
+++ b/docs/manual.rst
@@ -1516,6 +1516,7 @@ Its declaration looks like this::
void set_download_limit(int limit) const;
int download_limit() const;
void set_sequential_download(bool sd) const;
+ bool is_sequential_download() const;
void set_peer_upload_limit(asio::ip::tcp::endpoint ip, int limit) const;
void set_peer_download_limit(asio::ip::tcp::endpoint ip, int limit) const;
@@ -1749,19 +1750,23 @@ limit.
download, respectively.
-set_sequential_download()
--------------------------
+set_sequential_download() is_sequential_download()
+--------------------------------------------------
::
void set_sequential_download(bool sd);
+ bool is_sequential_download() const;
-Enables or disables *sequential download*. When enabled, the piece picker will pick pieces in sequence
-instead of rarest first.
+``set_sequential_download()`` enables or disables *sequential download*. When enabled, the piece
+picker will pick pieces in sequence instead of rarest first.
Enabling sequential download will affect the piece distribution negatively in the swarm. It should be
used sparingly.
+``is_sequential_download()`` returns true if this torrent is downloading in sequence, and false
+otherwise.
+
set_peer_upload_limit() set_peer_download_limit()
-------------------------------------------------
diff --git a/include/libtorrent/torrent.hpp b/include/libtorrent/torrent.hpp
index d08ee8b89..7f1e5f944 100755
--- a/include/libtorrent/torrent.hpp
+++ b/include/libtorrent/torrent.hpp
@@ -171,6 +171,8 @@ namespace libtorrent
aux::session_impl& session() { return m_ses; }
void set_sequential_download(bool sd);
+ bool is_sequential_download() const
+ { return m_sequential_download; }
void set_queue_position(int p);
int queue_position() const { return m_sequence_number; }
diff --git a/include/libtorrent/torrent_handle.hpp b/include/libtorrent/torrent_handle.hpp
index 636e842f0..25e9bbf21 100755
--- a/include/libtorrent/torrent_handle.hpp
+++ b/include/libtorrent/torrent_handle.hpp
@@ -429,6 +429,7 @@ namespace libtorrent
int download_limit() const;
void set_sequential_download(bool sd) const;
+ bool is_sequential_download() const;
void set_peer_upload_limit(tcp::endpoint ip, int limit) const;
void set_peer_download_limit(tcp::endpoint ip, int limit) const;
diff --git a/src/torrent_handle.cpp b/src/torrent_handle.cpp
index fe70c4b92..31e28e3a6 100755
--- a/src/torrent_handle.cpp
+++ b/src/torrent_handle.cpp
@@ -344,6 +344,12 @@ namespace libtorrent
TORRENT_FORWARD(set_sequential_download(sd));
}
+ bool torrent_handle::is_sequential_download() const
+ {
+ INVARIANT_CHECK;
+ TORRENT_FORWARD_RETURN(is_sequential_download(), false);
+ }
+
std::string torrent_handle::name() const
{
INVARIANT_CHECK;