|
|
@ -4270,6 +4270,9 @@ void Session::handleAlert(const lt::alert *a) |
|
|
|
case lt::file_error_alert::alert_type: |
|
|
|
case lt::file_error_alert::alert_type: |
|
|
|
handleFileErrorAlert(static_cast<const lt::file_error_alert*>(a)); |
|
|
|
handleFileErrorAlert(static_cast<const lt::file_error_alert*>(a)); |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
case lt::read_piece_alert::alert_type: |
|
|
|
|
|
|
|
handleReadPieceAlert(static_cast<const lt::read_piece_alert*>(a)); |
|
|
|
|
|
|
|
break; |
|
|
|
case lt::add_torrent_alert::alert_type: |
|
|
|
case lt::add_torrent_alert::alert_type: |
|
|
|
handleAddTorrentAlert(static_cast<const lt::add_torrent_alert*>(a)); |
|
|
|
handleAddTorrentAlert(static_cast<const lt::add_torrent_alert*>(a)); |
|
|
|
break; |
|
|
|
break; |
|
|
@ -4388,6 +4391,15 @@ void Session::createTorrentHandle(const lt::torrent_handle &nativeHandle) |
|
|
|
// Torrent could have error just after adding to libtorrent
|
|
|
|
// Torrent could have error just after adding to libtorrent
|
|
|
|
if (torrent->hasError()) |
|
|
|
if (torrent->hasError()) |
|
|
|
LogMsg(tr("Torrent errored. Torrent: \"%1\". Error: %2.").arg(torrent->name(), torrent->error()), Log::WARNING); |
|
|
|
LogMsg(tr("Torrent errored. Torrent: \"%1\". Error: %2.").arg(torrent->name(), torrent->error()), Log::WARNING); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Check if file(s) exist when using seed mode
|
|
|
|
|
|
|
|
if (params.skipChecking && torrent->hasMetadata()) { |
|
|
|
|
|
|
|
#if (LIBTORRENT_VERSION_NUM < 10200) |
|
|
|
|
|
|
|
nativeHandle.read_piece(0); |
|
|
|
|
|
|
|
#else |
|
|
|
|
|
|
|
nativeHandle.read_piece(lt::piece_index_t(0)); |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void Session::handleAddTorrentAlert(const lt::add_torrent_alert *p) |
|
|
|
void Session::handleAddTorrentAlert(const lt::add_torrent_alert *p) |
|
|
@ -4492,6 +4504,21 @@ void Session::handleFileErrorAlert(const lt::file_error_alert *p) |
|
|
|
m_recentErroredTorrentsTimer->start(); |
|
|
|
m_recentErroredTorrentsTimer->start(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void Session::handleReadPieceAlert(const lt::read_piece_alert *p) const |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
#if (LIBTORRENT_VERSION_NUM < 10200) |
|
|
|
|
|
|
|
if (p->ec) { |
|
|
|
|
|
|
|
p->handle.auto_managed(false); |
|
|
|
|
|
|
|
p->handle.force_recheck(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
#else |
|
|
|
|
|
|
|
if (p->error) { |
|
|
|
|
|
|
|
p->handle.unset_flags(lt::torrent_flags::auto_managed); |
|
|
|
|
|
|
|
p->handle.force_recheck(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void Session::handlePortmapWarningAlert(const lt::portmap_error_alert *p) |
|
|
|
void Session::handlePortmapWarningAlert(const lt::portmap_error_alert *p) |
|
|
|
{ |
|
|
|
{ |
|
|
|
LogMsg(tr("UPnP/NAT-PMP: Port mapping failure, message: %1").arg(QString::fromStdString(p->message())), Log::CRITICAL); |
|
|
|
LogMsg(tr("UPnP/NAT-PMP: Port mapping failure, message: %1").arg(QString::fromStdString(p->message())), Log::CRITICAL); |
|
|
|