1
0
Fork 0
forked from len0rd/rockbox

Don't connect the headerFinished slot during each get. Fixes the header result getting evaluated more than once if a HttpGet object is reused.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20447 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Dominik Riebeling 2009-03-22 08:50:55 +00:00
parent 5274dfd86a
commit ba830e4cfe

View file

@ -51,13 +51,18 @@ HttpGet::HttpGet(QObject *parent)
m_serverTimestamp = QDateTime();
connect(&http, SIGNAL(done(bool)), this, SLOT(httpDone(bool)));
connect(&http, SIGNAL(dataReadProgress(int, int)), this, SIGNAL(dataReadProgress(int, int)));
connect(&http, SIGNAL(requestFinished(int, bool)), this, SLOT(httpFinished(int, bool)));
connect(&http, SIGNAL(responseHeaderReceived(const QHttpResponseHeader&)), this, SLOT(httpResponseHeader(const QHttpResponseHeader&)));
connect(&http, SIGNAL(dataReadProgress(int, int)),
this, SIGNAL(dataReadProgress(int, int)));
connect(&http, SIGNAL(requestFinished(int, bool)),
this, SLOT(httpFinished(int, bool)));
connect(&http, SIGNAL(responseHeaderReceived(const QHttpResponseHeader&)),
this, SLOT(httpResponseHeader(const QHttpResponseHeader&)));
// connect(&http, SIGNAL(stateChanged(int)), this, SLOT(httpState(int)));
connect(&http, SIGNAL(requestStarted(int)), this, SLOT(httpStarted(int)));
connect(&http, SIGNAL(readyRead(const QHttpResponseHeader&)), this, SLOT(httpResponseHeader(const QHttpResponseHeader&)));
connect(&http, SIGNAL(readyRead(const QHttpResponseHeader&)),
this, SLOT(httpResponseHeader(const QHttpResponseHeader&)));
connect(this, SIGNAL(headerFinished()), this, SLOT(getFileFinish()));
}
@ -210,7 +215,6 @@ bool HttpGet::getFile(const QUrl &url)
}
else {
// schedule HTTP header request
connect(this, SIGNAL(headerFinished()), this, SLOT(getFileFinish()));
m_header.setRequest("HEAD", m_path + m_query);
headRequest = http.request(m_header);
qDebug() << "[HTTP] HEAD scheduled: " << headRequest;