From 635341f1e49e193d4170c682e602a8190e3a3c57 Mon Sep 17 00:00:00 2001
From: Arvid Norberg
Date: Thu, 21 Aug 2008 11:24:24 +0000
Subject: [PATCH] fixed the definition of torrent_handle::is_paused() to be
consistent with torrent_status::paused and made it clear in the documentation
---
docs/manual.html | 4 ++++
docs/manual.rst | 5 +++++
src/torrent_handle.cpp | 2 +-
3 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/docs/manual.html b/docs/manual.html
index a11d77ac2..6d72b866f 100644
--- a/docs/manual.html
+++ b/docs/manual.html
@@ -1922,6 +1922,10 @@ When a torrent is paused, it will however remember all share ratios to all peers
all potential (not connected) peers. You can use is_paused() to determine if a torrent
is currently paused. Torrents may be paused automatically if there is a file error (e.g. disk full)
or something similar. See file_error_alert.
+is_paused() only returns true if the torrent itself is paused. If the torrent
+is not running because the session is paused, this still returns true. To know if a
+torrent is active or not, you need to inspect both torrent_handle::is_paused()
+and session::is_paused().
diff --git a/docs/manual.rst b/docs/manual.rst
index 0c71d35c9..7d929769c 100644
--- a/docs/manual.rst
+++ b/docs/manual.rst
@@ -1852,6 +1852,11 @@ all potential (not connected) peers. You can use ``is_paused()`` to determine if
is currently paused. Torrents may be paused automatically if there is a file error (e.g. disk full)
or something similar. See file_error_alert_.
+``is_paused()`` only returns true if the torrent itself is paused. If the torrent
+is not running because the session is paused, this still returns true. To know if a
+torrent is active or not, you need to inspect both ``torrent_handle::is_paused()``
+and ``session::is_paused()``.
+
force_recheck()
---------------
diff --git a/src/torrent_handle.cpp b/src/torrent_handle.cpp
index b1ee00296..b02da4a6d 100644
--- a/src/torrent_handle.cpp
+++ b/src/torrent_handle.cpp
@@ -250,7 +250,7 @@ namespace libtorrent
bool torrent_handle::is_paused() const
{
INVARIANT_CHECK;
- TORRENT_FORWARD_RETURN(is_paused(), false);
+ TORRENT_FORWARD_RETURN(is_torrent_paused(), false);
}
void torrent_handle::pause() const