mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-30 11:38:50 -07: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:
parent
8b330e3ac0
commit
8bb34482ea
3 changed files with 35 additions and 13 deletions
|
@ -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;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue