*** empty log message ***

This commit is contained in:
Arvid Norberg
2005-06-06 10:33:44 +00:00
parent 3ba7f05bb9
commit 2d4c01ec65
6 changed files with 109 additions and 43 deletions

View File

@@ -94,41 +94,42 @@
<li><a class="reference" href="#alerts" id="id74" name="id74">alerts</a><ul> <li><a class="reference" href="#alerts" id="id74" name="id74">alerts</a><ul>
<li><a class="reference" href="#listen-failed-alert" id="id75" name="id75">listen_failed_alert</a></li> <li><a class="reference" href="#listen-failed-alert" id="id75" name="id75">listen_failed_alert</a></li>
<li><a class="reference" href="#file-error-alert" id="id76" name="id76">file_error_alert</a></li> <li><a class="reference" href="#file-error-alert" id="id76" name="id76">file_error_alert</a></li>
<li><a class="reference" href="#tracker-alert" id="id77" name="id77">tracker_alert</a></li> <li><a class="reference" href="#tracker-announce-alert" id="id77" name="id77">tracker_announce_alert</a></li>
<li><a class="reference" href="#tracker-reply-alert" id="id78" name="id78">tracker_reply_alert</a></li> <li><a class="reference" href="#tracker-alert" id="id78" name="id78">tracker_alert</a></li>
<li><a class="reference" href="#hash-failed-alert" id="id79" name="id79">hash_failed_alert</a></li> <li><a class="reference" href="#tracker-reply-alert" id="id79" name="id79">tracker_reply_alert</a></li>
<li><a class="reference" href="#peer-ban-alert" id="id80" name="id80">peer_ban_alert</a></li> <li><a class="reference" href="#hash-failed-alert" id="id80" name="id80">hash_failed_alert</a></li>
<li><a class="reference" href="#peer-error-alert" id="id81" name="id81">peer_error_alert</a></li> <li><a class="reference" href="#peer-ban-alert" id="id81" name="id81">peer_ban_alert</a></li>
<li><a class="reference" href="#invalid-request-alert" id="id82" name="id82">invalid_request_alert</a></li> <li><a class="reference" href="#peer-error-alert" id="id82" name="id82">peer_error_alert</a></li>
<li><a class="reference" href="#torrent-finished-alert" id="id83" name="id83">torrent_finished_alert</a></li> <li><a class="reference" href="#invalid-request-alert" id="id83" name="id83">invalid_request_alert</a></li>
<li><a class="reference" href="#metadata-received-alert" id="id84" name="id84">metadata_received_alert</a></li> <li><a class="reference" href="#torrent-finished-alert" id="id84" name="id84">torrent_finished_alert</a></li>
<li><a class="reference" href="#dispatcher" id="id85" name="id85">dispatcher</a></li> <li><a class="reference" href="#metadata-received-alert" id="id85" name="id85">metadata_received_alert</a></li>
<li><a class="reference" href="#dispatcher" id="id86" name="id86">dispatcher</a></li>
</ul> </ul>
</li> </li>
<li><a class="reference" href="#exceptions" id="id86" name="id86">exceptions</a><ul> <li><a class="reference" href="#exceptions" id="id87" name="id87">exceptions</a><ul>
<li><a class="reference" href="#invalid-handle" id="id87" name="id87">invalid_handle</a></li> <li><a class="reference" href="#invalid-handle" id="id88" name="id88">invalid_handle</a></li>
<li><a class="reference" href="#duplicate-torrent" id="id88" name="id88">duplicate_torrent</a></li> <li><a class="reference" href="#duplicate-torrent" id="id89" name="id89">duplicate_torrent</a></li>
<li><a class="reference" href="#invalid-encoding" id="id89" name="id89">invalid_encoding</a></li> <li><a class="reference" href="#invalid-encoding" id="id90" name="id90">invalid_encoding</a></li>
<li><a class="reference" href="#type-error" id="id90" name="id90">type_error</a></li> <li><a class="reference" href="#type-error" id="id91" name="id91">type_error</a></li>
<li><a class="reference" href="#invalid-torrent-file" id="id91" name="id91">invalid_torrent_file</a></li> <li><a class="reference" href="#invalid-torrent-file" id="id92" name="id92">invalid_torrent_file</a></li>
</ul> </ul>
</li> </li>
<li><a class="reference" href="#examples" id="id92" name="id92">examples</a><ul> <li><a class="reference" href="#examples" id="id93" name="id93">examples</a><ul>
<li><a class="reference" href="#dump-torrent" id="id93" name="id93">dump_torrent</a></li> <li><a class="reference" href="#dump-torrent" id="id94" name="id94">dump_torrent</a></li>
<li><a class="reference" href="#simple-client" id="id94" name="id94">simple client</a></li> <li><a class="reference" href="#simple-client" id="id95" name="id95">simple client</a></li>
</ul> </ul>
</li> </li>
<li><a class="reference" href="#fast-resume" id="id95" name="id95">fast resume</a><ul> <li><a class="reference" href="#fast-resume" id="id96" name="id96">fast resume</a><ul>
<li><a class="reference" href="#file-format" id="id96" name="id96">file format</a></li> <li><a class="reference" href="#file-format" id="id97" name="id97">file format</a></li>
</ul> </ul>
</li> </li>
<li><a class="reference" href="#extensions" id="id97" name="id97">extensions</a><ul> <li><a class="reference" href="#extensions" id="id98" name="id98">extensions</a><ul>
<li><a class="reference" href="#chat-messages" id="id98" name="id98">chat messages</a></li> <li><a class="reference" href="#chat-messages" id="id99" name="id99">chat messages</a></li>
<li><a class="reference" href="#metadata-from-peers" id="id99" name="id99">metadata from peers</a></li> <li><a class="reference" href="#metadata-from-peers" id="id100" name="id100">metadata from peers</a></li>
</ul> </ul>
</li> </li>
<li><a class="reference" href="#filename-checks" id="id100" name="id100">filename checks</a></li> <li><a class="reference" href="#filename-checks" id="id101" name="id101">filename checks</a></li>
<li><a class="reference" href="#acknowledgements" id="id101" name="id101">acknowledgements</a></li> <li><a class="reference" href="#acknowledgements" id="id102" name="id102">acknowledgements</a></li>
</ul> </ul>
</div> </div>
<div class="section" id="introduction"> <div class="section" id="introduction">
@@ -1205,6 +1206,7 @@ struct torrent_status
checking_files, checking_files,
connecting_to_tracker, connecting_to_tracker,
downloading, downloading,
finished,
seeding seeding
}; };
@@ -1274,6 +1276,11 @@ most torrents will be in most of the time. The progress
meter will tell how much of the files that has been meter will tell how much of the files that has been
downloaded.</td> downloaded.</td>
</tr> </tr>
<tr><td><tt class="docutils literal"><span class="pre">finished</span></tt></td>
<td>In this state the torrent has finished downloading but
still doesn't have the entire torrent. i.e. some pieces
are filtered and won't get downloaded.</td>
</tr>
<tr><td><tt class="docutils literal"><span class="pre">seeding</span></tt></td> <tr><td><tt class="docutils literal"><span class="pre">seeding</span></tt></td>
<td>In this state the torrent has finished downloading and <td>In this state the torrent has finished downloading and
is a pure seeder.</td> is a pure seeder.</td>
@@ -1792,6 +1799,23 @@ struct file_error_alert: alert
}; };
</pre> </pre>
</div> </div>
<div class="section" id="tracker-announce-alert">
<h2><a name="tracker-announce-alert">tracker_announce_alert</a></h2>
<p>This alert is generated each time a tracker announce is sent (or attempted to be sent).
It is generated at severity level <tt class="docutils literal"><span class="pre">info</span></tt>.</p>
<pre class="literal-block">
struct tracker_announce_alert: alert
{
tracker_announce_alert(
const torrent_handle&amp; h
, const std::string&amp; msg);
virtual std::auto_ptr&lt;alert&gt; clone() const;
torrent_handle handle;
};
</pre>
</div>
<div class="section" id="tracker-alert"> <div class="section" id="tracker-alert">
<h2><a name="tracker-alert">tracker_alert</a></h2> <h2><a name="tracker-alert">tracker_alert</a></h2>
<p>This alert is generated on tracker time outs, premature disconnects, invalid response or <p>This alert is generated on tracker time outs, premature disconnects, invalid response or

View File

@@ -1802,6 +1802,25 @@ generated and the torrent is paused. It is generated as severity level ``fatal``
}; };
tracker_announce_alert
----------------------
This alert is generated each time a tracker announce is sent (or attempted to be sent).
It is generated at severity level ``info``.
::
struct tracker_announce_alert: alert
{
tracker_announce_alert(
const torrent_handle& h
, const std::string& msg);
virtual std::auto_ptr<alert> clone() const;
torrent_handle handle;
};
tracker_alert tracker_alert
------------- -------------

View File

@@ -42,10 +42,10 @@ namespace libtorrent
{ {
struct tracker_alert: alert struct tracker_alert: alert
{ {
tracker_alert(const torrent_handle& h tracker_alert(torrent_handle const& h
, int times , int times
, int status , int status
, const std::string& msg) , std::string const& msg)
: alert(alert::warning, msg) : alert(alert::warning, msg)
, handle(h) , handle(h)
, times_in_row(times) , times_in_row(times)
@@ -62,8 +62,8 @@ namespace libtorrent
struct tracker_reply_alert: alert struct tracker_reply_alert: alert
{ {
tracker_reply_alert(const torrent_handle& h tracker_reply_alert(torrent_handle const& h
, const std::string& msg) , std::string const& msg)
: alert(alert::info, msg) : alert(alert::info, msg)
, handle(h) , handle(h)
{} {}
@@ -73,13 +73,26 @@ namespace libtorrent
torrent_handle handle; torrent_handle handle;
}; };
struct tracker_announce_alert: alert
{
tracker_announce_alert(torrent_handle const& h, std::string const& msg)
: alert(alert::info, msg)
, handle(h)
{}
virtual std::auto_ptr<alert> clone() const
{ return std::auto_ptr<alert>(new tracker_announce_alert(*this)); }
torrent_handle handle;
};
struct hash_failed_alert: alert struct hash_failed_alert: alert
{ {
hash_failed_alert( hash_failed_alert(
const torrent_handle& h torrent_handle const& h
, int index , int index
, const std::string& msg) , std::string const& msg)
: alert(alert::info, msg) : alert(alert::info, msg)
, handle(h) , handle(h)
, piece_index(index) , piece_index(index)
@@ -94,7 +107,7 @@ namespace libtorrent
struct peer_ban_alert: alert struct peer_ban_alert: alert
{ {
peer_ban_alert(const address& pip, torrent_handle h, const std::string& msg) peer_ban_alert(address const& pip, torrent_handle h, std::string const& msg)
: alert(alert::info, msg) : alert(alert::info, msg)
, ip(pip) , ip(pip)
, handle(h) , handle(h)
@@ -109,7 +122,7 @@ namespace libtorrent
struct peer_error_alert: alert struct peer_error_alert: alert
{ {
peer_error_alert(address const& pip, peer_id const& pid, const std::string& msg) peer_error_alert(address const& pip, peer_id const& pid, std::string const& msg)
: alert(alert::debug, msg) : alert(alert::debug, msg)
, ip(pip) , ip(pip)
, id(pid) , id(pid)

View File

@@ -261,7 +261,7 @@ namespace libtorrent
void set_download_limit(int limit); void set_download_limit(int limit);
// manually connect a peer // manually connect a peer
void connect_peer(const address& adr) const; void connect_peer(address const& adr) const;
// valid ratios are 0 (infinite ratio) or [ 1.0 , inf ) // valid ratios are 0 (infinite ratio) or [ 1.0 , inf )
// the ratio is uploaded / downloaded. less than 1 is not allowed // the ratio is uploaded / downloaded. less than 1 is not allowed

View File

@@ -381,17 +381,14 @@ namespace libtorrent { namespace detail
} }
for (std::vector<boost::shared_ptr<libtorrent::socket> >::iterator i = for (std::vector<boost::shared_ptr<libtorrent::socket> >::iterator i =
writable_clients.begin(); writable_clients.begin(); i != writable_clients.end();
i != writable_clients.end();
++i) ++i)
{ {
assert((*i)->is_writable()); assert((*i)->is_writable());
} }
for (std::vector<boost::shared_ptr<libtorrent::socket> >::iterator i = for (std::vector<boost::shared_ptr<libtorrent::socket> >::iterator i =
readable_clients.begin(); readable_clients.begin(); i != readable_clients.end(); ++i)
i != readable_clients.end();
++i)
{ {
assert((*i)->is_readable()); assert((*i)->is_readable());
} }
@@ -429,9 +426,7 @@ namespace libtorrent { namespace detail
// let the writable connections send data // let the writable connections send data
for (std::vector<boost::shared_ptr<socket> >::iterator i for (std::vector<boost::shared_ptr<socket> >::iterator i
= writable_clients.begin(); = writable_clients.begin(); i != writable_clients.end(); ++i)
i != writable_clients.end();
++i)
{ {
assert((*i)->is_writable()); assert((*i)->is_writable());
connection_map::iterator p = m_connections.find(*i); connection_map::iterator p = m_connections.find(*i);
@@ -687,6 +682,14 @@ namespace libtorrent { namespace detail
req.listen_port = m_listen_interface.port; req.listen_port = m_listen_interface.port;
req.key = m_key; req.key = m_key;
m_tracker_manager.queue_request(req, t.tracker_login()); m_tracker_manager.queue_request(req, t.tracker_login());
if (m_alerts.should_post(alert::info))
{
m_alerts.post_alert(
tracker_announce_alert(
t.get_handle(), "tracker announce, event=stopped"));
}
#ifndef NDEBUG #ifndef NDEBUG
sha1_hash i_hash = t.torrent_file().info_hash(); sha1_hash i_hash = t.torrent_file().info_hash();
#endif #endif
@@ -700,6 +703,13 @@ namespace libtorrent { namespace detail
req.listen_port = m_listen_interface.port; req.listen_port = m_listen_interface.port;
req.key = m_key; req.key = m_key;
m_tracker_manager.queue_request(req, t.tracker_login(), i->second); m_tracker_manager.queue_request(req, t.tracker_login(), i->second);
if (m_alerts.should_post(alert::info))
{
m_alerts.post_alert(
tracker_announce_alert(
t.get_handle(), "tracker announce"));
}
} }
// tick() will set the used upload quota // tick() will set the used upload quota

View File

@@ -463,7 +463,7 @@ namespace libtorrent
, bind(&torrent::metadata, _1)); , bind(&torrent::metadata, _1));
} }
void torrent_handle::connect_peer(const address& adr) const void torrent_handle::connect_peer(address const& adr) const
{ {
INVARIANT_CHECK; INVARIANT_CHECK;