*** empty log message ***

This commit is contained in:
Arvid Norberg 2005-05-03 13:13:57 +00:00
parent b2a708fb05
commit d38e66a223
5 changed files with 43 additions and 2 deletions

View File

@ -5,11 +5,20 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.3.8: http://docutils.sourceforge.net/" />
<title>libtorrent manual</title>
<meta name="author" content="Arvid Norberg, c99ang&#64;cs.umu.se" />
<link rel="stylesheet" href="style.css" type="text/css" />
</head>
<body>
<div class="document" id="libtorrent-manual">
<h1 class="title">libtorrent manual</h1>
<table class="docinfo" frame="void" rules="none">
<col class="docinfo-name" />
<col class="docinfo-content" />
<tbody valign="top">
<tr><th class="docinfo-name">Author:</th>
<td>Arvid Norberg, <a class="last reference" href="mailto:c99ang&#64;cs.umu.se">c99ang&#64;cs.umu.se</a></td></tr>
</tbody>
</table>
<div class="contents topic" id="contents">
<p class="topic-title first"><a name="contents">Contents</a></p>
<ul class="simple">

View File

@ -2,6 +2,8 @@
libtorrent manual
=================
:Author: Arvid Norberg, c99ang@cs.umu.se
.. contents::
introduction

View File

@ -222,6 +222,7 @@ namespace libtorrent
// forcefully sets next_announce to the current time
void force_tracker_request();
void force_tracker_request(boost::posix_time::ptime);
// sets the username and password that will be sent to
// the tracker
@ -501,10 +502,17 @@ namespace libtorrent
inline void torrent::force_tracker_request()
{
namespace time = boost::posix_time;
m_next_request = time::second_clock::universal_time();
using boost::posix_time::second_clock;
m_next_request = second_clock::universal_time();
}
inline void torrent::force_tracker_request(boost::posix_time::ptime t)
{
namespace time = boost::posix_time;
m_next_request = t;
}
inline void torrent::set_tracker_login(
std::string const& name
, std::string const& pw)

View File

@ -225,6 +225,12 @@ namespace libtorrent
// (make a rerequest from the tracker)
void force_reannounce() const;
// forces a reannounce in the specified amount of time.
// This overrides the default announce interval, and no
// announce will take place until the given time has
// timed out.
void force_reannounce(boost::posix_time::time_duration) const;
// TODO: add a feature where the user can tell the torrent
// to finish all pieces currently in the pipeline, and then
// abort the torrent.

View File

@ -510,6 +510,22 @@ namespace libtorrent
t->get_policy().peer_from_tracker(adr, id);
}
void torrent_handle::force_reannounce(
boost::posix_time::time_duration duration) const
{
INVARIANT_CHECK;
if (m_ses == 0) throw invalid_handle();
boost::mutex::scoped_lock l(m_ses->m_mutex);
torrent* t = m_ses->find_torrent(m_info_hash);
if (t == 0) throw invalid_handle();
using boost::posix_time::second_clock;
t->force_tracker_request(second_clock::universal_time()
+ duration);
}
void torrent_handle::force_reannounce() const
{
INVARIANT_CHECK;