forked from premiere/premiere-libtorrent
improved error reporting on http seed failures
This commit is contained in:
parent
0fe9f53410
commit
b17710df09
|
@ -2614,7 +2614,7 @@ It contains ``url`` to the HTTP seed that failed along with an error message.
|
|||
|
||||
struct url_seed_alert: torrent_alert
|
||||
{
|
||||
url_seed_alert(torrent_handle const& h, std::string const& h
|
||||
url_seed_alert(torrent_handle const& h, std::string const& url
|
||||
, const std::string& msg);
|
||||
virtual std::auto_ptr<alert> clone() const;
|
||||
|
||||
|
|
|
@ -318,8 +318,15 @@ namespace libtorrent
|
|||
{
|
||||
// we should not try this server again.
|
||||
t->remove_url_seed(m_url);
|
||||
throw std::runtime_error(boost::lexical_cast<std::string>(m_parser.status_code())
|
||||
+ " " + m_parser.message());
|
||||
std::string error_msg = boost::lexical_cast<std::string>(m_parser.status_code())
|
||||
+ " " + m_parser.message();
|
||||
if (m_ses.m_alerts.should_post(alert::warning))
|
||||
{
|
||||
session_impl::mutex_t::scoped_lock l(m_ses.m_mutex);
|
||||
m_ses.m_alerts.post_alert(url_seed_alert(t->get_handle(), url()
|
||||
, error_msg));
|
||||
}
|
||||
throw std::runtime_error(error_msg);
|
||||
}
|
||||
|
||||
if (!m_parser.header_finished()) break;
|
||||
|
|
Loading…
Reference in New Issue