mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-24 02:42:48 +00:00
kioslave: implement resume metadata for http slave
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
c92d1b598d
commit
25ce9292bb
1 changed files with 11 additions and 1 deletions
|
@ -238,13 +238,23 @@ void HttpProtocol::get(const KUrl &url)
|
|||
}
|
||||
|
||||
if (hasMetaData(QLatin1String("referrer"))) {
|
||||
const QString referrerbytes = metaData("referrer").toAscii();
|
||||
const QByteArray referrerbytes = metaData("referrer").toAscii();
|
||||
curlresult = curl_easy_setopt(m_curl, CURLOPT_REFERER, referrerbytes.constData());
|
||||
if (curlresult != CURLE_OK) {
|
||||
kWarning(7103) << curl_easy_strerror(curlresult);
|
||||
}
|
||||
}
|
||||
|
||||
if (hasMetaData(QLatin1String("resume"))) {
|
||||
const qlonglong resumeoffset = metaData(QLatin1String("resume")).toLongLong();
|
||||
curlresult = curl_easy_setopt(m_curl, CURLOPT_RESUME_FROM_LARGE, resumeoffset);
|
||||
if (curlresult != CURLE_OK) {
|
||||
kWarning(7103) << curl_easy_strerror(curlresult);
|
||||
} else {
|
||||
canResume();
|
||||
}
|
||||
}
|
||||
|
||||
struct curl_slist *curllist = NULL;
|
||||
if (hasMetaData(QLatin1String("Languages"))) {
|
||||
curllist = curl_slist_append(curllist, QByteArray("Accept-Language: ") + metaData("Languages").toAscii());
|
||||
|
|
Loading…
Add table
Reference in a new issue