Browse Source

Log performance alerts from libtorrent

adaptive-webui-19844
Chocobo1 6 years ago
parent
commit
45bafab4e0
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C
  1. 5
      src/base/bittorrent/session.cpp
  2. 9
      src/base/bittorrent/torrenthandle.cpp
  3. 1
      src/base/bittorrent/torrenthandle.h

5
src/base/bittorrent/session.cpp

@ -385,8 +385,9 @@ Session::Session(QObject *parent)
| lt::alert::tracker_notification | lt::alert::tracker_notification
| lt::alert::status_notification | lt::alert::status_notification
| lt::alert::ip_block_notification | lt::alert::ip_block_notification
| lt::alert::file_progress_notification | lt::alert::performance_warning
| lt::alert::stats_notification; | lt::alert::stats_notification
| lt::alert::file_progress_notification;
const std::string peerId = lt::generate_fingerprint(PEER_ID, QBT_VERSION_MAJOR, QBT_VERSION_MINOR, QBT_VERSION_BUGFIX, QBT_VERSION_BUILD); const std::string peerId = lt::generate_fingerprint(PEER_ID, QBT_VERSION_MAJOR, QBT_VERSION_MINOR, QBT_VERSION_BUGFIX, QBT_VERSION_BUILD);
lt::settings_pack pack; lt::settings_pack pack;

9
src/base/bittorrent/torrenthandle.cpp

@ -1835,6 +1835,12 @@ void TorrentHandle::handleMetadataReceivedAlert(const lt::metadata_received_aler
} }
} }
void TorrentHandle::handlePerformanceAlert(const lt::performance_alert *p) const
{
LogMsg((tr("Performance alert: ") + QString::fromStdString(p->message()))
, Log::INFO);
}
void TorrentHandle::handleTempPathChanged() void TorrentHandle::handleTempPathChanged()
{ {
adjustActualSavePath(); adjustActualSavePath();
@ -1907,6 +1913,9 @@ void TorrentHandle::handleAlert(const lt::alert *a)
case lt::torrent_checked_alert::alert_type: case lt::torrent_checked_alert::alert_type:
handleTorrentCheckedAlert(static_cast<const lt::torrent_checked_alert*>(a)); handleTorrentCheckedAlert(static_cast<const lt::torrent_checked_alert*>(a));
break; break;
case lt::performance_alert::alert_type:
handlePerformanceAlert(static_cast<const lt::performance_alert*>(a));
break;
} }
} }

1
src/base/bittorrent/torrenthandle.h

@ -365,6 +365,7 @@ namespace BitTorrent
void handleFileRenamedAlert(const lt::file_renamed_alert *p); void handleFileRenamedAlert(const lt::file_renamed_alert *p);
void handleFileRenameFailedAlert(const lt::file_rename_failed_alert *p); void handleFileRenameFailedAlert(const lt::file_rename_failed_alert *p);
void handleMetadataReceivedAlert(const lt::metadata_received_alert *p); void handleMetadataReceivedAlert(const lt::metadata_received_alert *p);
void handlePerformanceAlert(const lt::performance_alert *p) const;
void handleSaveResumeDataAlert(const lt::save_resume_data_alert *p); void handleSaveResumeDataAlert(const lt::save_resume_data_alert *p);
void handleSaveResumeDataFailedAlert(const lt::save_resume_data_failed_alert *p); void handleSaveResumeDataFailedAlert(const lt::save_resume_data_failed_alert *p);
void handleStatsAlert(const lt::stats_alert *p); void handleStatsAlert(const lt::stats_alert *p);

Loading…
Cancel
Save