mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 10:22:48 +00:00
kioslave: set the CURLOPT_NOBODY option to true for stat() in curl slave
I know one such server tho I do not care about it now so I am putting the option back in place Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
45324eac58
commit
27c58cb772
1 changed files with 13 additions and 4 deletions
|
@ -224,8 +224,8 @@ static inline KIO::Error curlToKIOError(const CURLcode curlcode, CURL *curl)
|
|||
case CURLE_REMOTE_ACCESS_DENIED: {
|
||||
return KIO::ERR_ACCESS_DENIED;
|
||||
}
|
||||
case CURLE_FILE_COULDNT_READ_FILE:
|
||||
case CURLE_READ_ERROR: {
|
||||
case CURLE_READ_ERROR:
|
||||
case CURLE_FILE_COULDNT_READ_FILE: {
|
||||
return KIO::ERR_COULD_NOT_READ;
|
||||
}
|
||||
case CURLE_WRITE_ERROR:
|
||||
|
@ -408,12 +408,21 @@ void CurlProtocol::stat(const KUrl &url)
|
|||
return;
|
||||
}
|
||||
|
||||
if (m_isftp) {
|
||||
CURLcode curlresult = CURLE_OK;
|
||||
if (m_ishttp) {
|
||||
// NOTE: it is known that some servers do not send some headers on HEAD, contact the server
|
||||
// maintainer(s) if you encounter such case - it is not an issue that needs a fix here
|
||||
curlresult = curl_easy_setopt(m_curl, CURLOPT_NOBODY, 1L);
|
||||
if (curlresult != CURLE_OK) {
|
||||
KIO_CURL_ERROR(curlresult);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
m_collectdata = true;
|
||||
}
|
||||
|
||||
KUrl redirecturl;
|
||||
CURLcode curlresult = performCurl(url, &redirecturl);
|
||||
curlresult = performCurl(url, &redirecturl);
|
||||
kDebug(7103) << "Stat result" << curlresult;
|
||||
if (curlresult != CURLE_OK) {
|
||||
const KIO::Error kioerror = curlToKIOError(curlresult, m_curl);
|
||||
|
|
Loading…
Add table
Reference in a new issue