Browse Source

Add logging for SOCKS5 proxy errors

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

15
src/base/bittorrent/session.cpp

@ -4407,6 +4407,11 @@ void Session::handleAlert(const lt::alert *a) @@ -4407,6 +4407,11 @@ void Session::handleAlert(const lt::alert *a)
case lt::storage_moved_failed_alert::alert_type:
handleStorageMovedFailedAlert(static_cast<const lt::storage_moved_failed_alert*>(a));
break;
#if (LIBTORRENT_VERSION_NUM >= 10204)
case lt::socks5_alert::alert_type:
handleSocks5Alert(static_cast<const lt::socks5_alert *>(a));
break;
#endif
}
}
catch (const std::exception &exc) {
@ -4942,3 +4947,13 @@ void Session::handleStateUpdateAlert(const lt::state_update_alert *p) @@ -4942,3 +4947,13 @@ void Session::handleStateUpdateAlert(const lt::state_update_alert *p)
if (!updatedTorrents.isEmpty())
emit torrentsUpdated(updatedTorrents);
}
#if (LIBTORRENT_VERSION_NUM >= 10204)
void Session::handleSocks5Alert(const lt::socks5_alert *p) const
{
if (p->error) {
LogMsg(tr("SOCKS5 proxy error. Message: %1").arg(QString::fromStdString(p->message()))
, Log::WARNING);
}
}
#endif

3
src/base/bittorrent/session.h

@ -596,6 +596,9 @@ namespace BitTorrent @@ -596,6 +596,9 @@ namespace BitTorrent
#endif
void handleStorageMovedAlert(const lt::storage_moved_alert *p);
void handleStorageMovedFailedAlert(const lt::storage_moved_failed_alert *p);
#if (LIBTORRENT_VERSION_NUM >= 10204)
void handleSocks5Alert(const lt::socks5_alert *p) const;
#endif
void createTorrentHandle(const lt::torrent_handle &nativeHandle);

Loading…
Cancel
Save