mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-17 22:18:05 -06:00
Fix periodic latency spikes on Windows with WiFi connections. Closes #4209.
This commit is contained in:
@@ -215,6 +215,21 @@ int main(int argc, char *argv[])
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
#if defined(Q_OS_WIN) && defined(QBT_USES_QT5)
|
||||
// This affects only Windows apparently and Qt5.
|
||||
// When QNetworkAccessManager is instantiated it regularly starts polling
|
||||
// the network interfaces to see what's available and their status.
|
||||
// This polling creates jitter and high ping with wifi interfaces.
|
||||
// So here we disable it for lack of better measure.
|
||||
// It will also spew this message in the console: QObject::startTimer: Timers cannot have negative intervals
|
||||
// For more info see:
|
||||
// 1. https://github.com/qbittorrent/qBittorrent/issues/4209
|
||||
// 2. https://bugreports.qt.io/browse/QTBUG-40332
|
||||
// 3. https://bugreports.qt.io/browse/QTBUG-46015
|
||||
|
||||
qputenv("QT_BEARER_POLL_TIMEOUT", QByteArray::number(-1));
|
||||
#endif
|
||||
|
||||
#ifndef DISABLE_GUI
|
||||
if (!upgrade()) return EXIT_FAILURE;
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user