mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-21 07:57:22 -06:00
Handle HTTP redirections manually
Qt doesn't support Magnet protocol so we need to handle all redirections manually to allow redirections to Magnet URIs.
This commit is contained in:
committed by
sledgehammer999
parent
6ad1ba1d35
commit
5e73afa04e
@@ -42,7 +42,7 @@ class DownloadHandlerImpl : public Net::DownloadHandler
|
||||
Q_DISABLE_COPY(DownloadHandlerImpl)
|
||||
|
||||
public:
|
||||
explicit DownloadHandlerImpl(const Net::DownloadRequest &downloadRequest, QObject *parent);
|
||||
DownloadHandlerImpl(Net::DownloadManager *manager, const Net::DownloadRequest &downloadRequest);
|
||||
~DownloadHandlerImpl() override;
|
||||
|
||||
void cancel() override;
|
||||
@@ -61,7 +61,9 @@ private:
|
||||
|
||||
static QString errorCodeToString(QNetworkReply::NetworkError status);
|
||||
|
||||
Net::DownloadManager *m_manager = nullptr;
|
||||
QNetworkReply *m_reply = nullptr;
|
||||
const Net::DownloadRequest m_downloadRequest;
|
||||
short m_redirectionCount = 0;
|
||||
Net::DownloadResult m_result;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user