kioslave: send KIO error codes from curl slave where possible

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2024-03-17 19:23:40 +02:00
parent c8769ed4f3
commit 0269b70b0a

View file

@ -367,7 +367,8 @@ void CurlProtocol::stat(const KUrl &url)
if (kioerror == KIO::ERR_COULD_NOT_LOGIN) {
curlresult = authUrl(url);
if (curlresult != CURLE_OK) {
KIO_CURL_ERROR(curlresult);
kioerror = curlToKIOError(curlresult, m_curl);
error(kioerror, url.prettyUrl());
return;
}
}
@ -449,7 +450,8 @@ void CurlProtocol::listDir(const KUrl &url)
if (kioerror == KIO::ERR_COULD_NOT_LOGIN) {
curlresult = authUrl(url);
if (curlresult != CURLE_OK) {
KIO_CURL_ERROR(curlresult);
kioerror = curlToKIOError(curlresult, m_curl);
error(kioerror, url.prettyUrl());
return;
}
}
@ -553,7 +555,8 @@ void CurlProtocol::get(const KUrl &url)
if (kioerror == KIO::ERR_COULD_NOT_LOGIN) {
curlresult = authUrl(url);
if (curlresult != CURLE_OK) {
KIO_CURL_ERROR(curlresult);
kioerror = curlToKIOError(curlresult, m_curl);
error(kioerror, url.prettyUrl());
return;
}
}
@ -847,7 +850,7 @@ CURLcode CurlProtocol::authUrlFromCache(const KUrl &url)
kioauthinfo.username = url.userName();
kioauthinfo.password = url.password();
if (checkCachedAuthentication(kioauthinfo)) {
CURLcode curlresult = setupAuth(kioauthinfo.username, kioauthinfo.password);
const CURLcode curlresult = setupAuth(kioauthinfo.username, kioauthinfo.password);
if (curlresult != CURLE_OK) {
return curlresult;
}