introduced a new alert torrent_update_alert, for when a torrent_handle changes info-hash

This commit is contained in:
Arvid Norberg
2013-05-17 03:19:23 +00:00
parent ef87b3ada9
commit 360c6a6e16
5 changed files with 63 additions and 0 deletions

View File

@@ -463,6 +463,12 @@ the torrent will be stopped and the torrent error state (``torrent_status::error
will indicate what went wrong. The ``url`` may refer to a magnet link or a regular
http URL.
If it refers to an HTTP URL, the info-hash for the added torrent will not be the
true info-hash of the .torrent. Instead a placeholder, unique, info-hash is used
which is later updated once the .torrent file has been downloaded.
Once the info-hash change happens, a torrent_update_alert_ is posted.
``dht_nodes`` is a list of hostname and port pairs, representing DHT nodes to be
added to the session (if DHT is enabled). The hostname may be an IP address.
@@ -7702,6 +7708,26 @@ this message was posted. Note that you can map a torrent status to a specific to
via its ``handle`` member. The receiving end is suggested to have all torrents sorted
by the ``torrent_handle`` or hashed by it, for efficient updates.
torrent_update_alert
--------------------
When a torrent changes its info-hash, this alert is posted. This only happens in very
specific cases. For instance, when a torrent is downloaded from a URL, the true info
hash is not known immediately. First the .torrent file must be downloaded and parsed.
Once this download completes, the ``torrent_update_alert`` is posted to notify the client
of the info-hash changing.
::
struct torrent_update_alert: torrent_alert
{
// ...
sha1_hash old_ih;
sha1_hash new_ih;
};
``old_ih`` and ``new_ih`` are the previous and new info-hash for the torrent, respectively.
alert dispatcher
================