+
+
This alert is only for informational purpose. It is generated when a tracker announce
+succeeds. It is generated with severity level info.
+
+struct tracker_reply_alert: alert
+{
+ tracker_reply_alert(const torrent_handle& h
+ , const std::string& msg);
+
+ virtual std::auto_ptr<alert> clone() const;
+ torrent_handle handle;
+};
+
+
This alert is generated when a finished piece fails its hash check. You can get the handle
diff --git a/docs/manual.rst b/docs/manual.rst
index 03a28de53..bbbdd0b57 100755
--- a/docs/manual.rst
+++ b/docs/manual.rst
@@ -1783,6 +1783,23 @@ The ``times_in_row`` member says how many times in a row this tracker has failed
};
+tracker_reply_alert
+-------------------
+
+This alert is only for informational purpose. It is generated when a tracker announce
+succeeds. It is generated with severity level ``info``.
+
+::
+
+ struct tracker_reply_alert: alert
+ {
+ tracker_reply_alert(const torrent_handle& h
+ , const std::string& msg);
+
+ virtual std::auto_ptr clone() const;
+ torrent_handle handle;
+ };
+
hash_failed_alert
-----------------
diff --git a/include/libtorrent/alert_types.hpp b/include/libtorrent/alert_types.hpp
index a2929d1ff..16f475ace 100755
--- a/include/libtorrent/alert_types.hpp
+++ b/include/libtorrent/alert_types.hpp
@@ -57,6 +57,20 @@ namespace libtorrent
int times_in_row;
};
+ struct tracker_reply_alert: alert
+ {
+ tracker_reply_alert(const torrent_handle& h
+ , const std::string& msg)
+ : alert(alert::info, msg)
+ , handle(h)
+ {}
+
+ virtual std::auto_ptr clone() const
+ { return std::auto_ptr(new tracker_reply_alert(*this)); }
+
+ torrent_handle handle;
+ };
+
struct hash_failed_alert: alert
{
hash_failed_alert(
diff --git a/src/torrent.cpp b/src/torrent.cpp
index 0d4c1da69..53b9bf9fe 100755
--- a/src/torrent.cpp
+++ b/src/torrent.cpp
@@ -343,6 +343,14 @@ namespace libtorrent
m_policy->peer_from_tracker(a, i->id);
}
+ if (m_ses.m_alerts.should_post(alert::info))
+ {
+ std::stringstream s;
+ s << "Got response from tracker: "
+ << m_trackers[m_last_working_tracker].url;
+ m_ses.m_alerts.post_alert(tracker_reply_alert(
+ get_handle(), s.str()));
+ }
m_got_tracker_response = true;
}
@@ -1053,7 +1061,7 @@ namespace libtorrent
if (m_last_working_tracker >= 0)
{
- st.current_tracker
+ st.current_tracker
= m_trackers[m_last_working_tracker].url;
}