In RedirectFollower, don't emit readyRead() from replies that contain a redirect header. Fixes issue 3000
This commit is contained in:
parent
4da488d6f0
commit
404deff537
|
@ -144,13 +144,22 @@ RedirectFollower::RedirectFollower(QNetworkReply* first_reply, int max_redirects
|
|||
}
|
||||
|
||||
void RedirectFollower::ConnectReply(QNetworkReply* reply) {
|
||||
connect(reply, SIGNAL(readyRead()), SIGNAL(readyRead()));
|
||||
connect(reply, SIGNAL(readyRead()), SLOT(ReadyRead()));
|
||||
connect(reply, SIGNAL(error(QNetworkReply::NetworkError)), SIGNAL(error(QNetworkReply::NetworkError)));
|
||||
connect(reply, SIGNAL(downloadProgress(qint64,qint64)), SIGNAL(downloadProgress(qint64,qint64)));
|
||||
connect(reply, SIGNAL(uploadProgress(qint64,qint64)), SIGNAL(uploadProgress(qint64,qint64)));
|
||||
connect(reply, SIGNAL(finished()), SLOT(ReplyFinished()));
|
||||
}
|
||||
|
||||
void RedirectFollower::ReadyRead() {
|
||||
// Don't re-emit this signal for redirect replies.
|
||||
if (current_reply_->attribute(QNetworkRequest::RedirectionTargetAttribute).isValid()) {
|
||||
return;
|
||||
}
|
||||
|
||||
emit readyRead();
|
||||
}
|
||||
|
||||
void RedirectFollower::ReplyFinished() {
|
||||
current_reply_->deleteLater();
|
||||
|
||||
|
|
|
@ -104,6 +104,7 @@ signals:
|
|||
void finished();
|
||||
|
||||
private slots:
|
||||
void ReadyRead();
|
||||
void ReplyFinished();
|
||||
|
||||
private:
|
||||
|
|
Loading…
Reference in New Issue