mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 10:22:48 +00:00
generic: effectively revert 972b231e4a
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
87686b2b7f
commit
631ba7bb15
2 changed files with 13 additions and 28 deletions
|
@ -80,7 +80,7 @@ static QString authInfoUrl(const KUrl &authinfourl, const bool removeuser)
|
|||
cleanurl.setPath(nullstring);
|
||||
cleanurl.setQuery(nullstring);
|
||||
cleanurl.setFragment(nullstring);
|
||||
return cleanurl.prettyUrl();
|
||||
return cleanurl.url();
|
||||
}
|
||||
|
||||
static QByteArray authInfoKey(const AuthInfo &authinfo)
|
||||
|
@ -571,18 +571,6 @@ void SlaveBase::reparseConfiguration()
|
|||
|
||||
bool SlaveBase::openPasswordDialog(AuthInfo& info, const QString &errorMsg)
|
||||
{
|
||||
KPasswdStore* passwdstore = d->passwdStore();
|
||||
Q_ASSERT(passwdstore);
|
||||
|
||||
if (!passwdstore->isOpen() && passwdstore->openStore()) {
|
||||
kDebug(7019) << "opening store for authorization" << info.url.prettyUrl();
|
||||
if (checkCachedAuthentication(info)) {
|
||||
// do not store the authorization, it was just pulled from the cache
|
||||
info.keepPassword = false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (metaData(QLatin1String("no-auth-prompt")).compare(QLatin1String("true"), Qt::CaseInsensitive) == 0) {
|
||||
kDebug(7019) << "not asking for authorization" << info.url.prettyUrl();
|
||||
return false;
|
||||
|
@ -936,12 +924,6 @@ bool SlaveBase::checkCachedAuthentication(AuthInfo &info)
|
|||
{
|
||||
KPasswdStore* passwdstore = d->passwdStore();
|
||||
Q_ASSERT(passwdstore);
|
||||
if (!passwdstore->isOpen() && !passwdstore->cacheOnly()) {
|
||||
// let it fail the first time, if authorization is really required openPasswordDialog()
|
||||
// will open the store and call this method
|
||||
kDebug(7019) << "initial cache check rejected" << info.url.prettyUrl();
|
||||
return false;
|
||||
}
|
||||
|
||||
const qlonglong windowId = metaData(QLatin1String("window-id")).toLongLong();
|
||||
QByteArray authkey = authInfoKey(info);
|
||||
|
|
|
@ -1069,22 +1069,25 @@ bool CurlProtocol::setupCurl(const KUrl &url, const bool ftp)
|
|||
|
||||
CURLcode CurlProtocol::performCurl(const KUrl &url, KUrl *redirecturl)
|
||||
{
|
||||
CURLcode curlresult = CURLE_OK;
|
||||
KIO::AuthInfo kioauthinfo;
|
||||
kioauthinfo.url = url;
|
||||
kioauthinfo.username = url.userName();
|
||||
kioauthinfo.password = url.password();
|
||||
if (checkCachedAuthentication(kioauthinfo)) {
|
||||
kDebug(7103) << "Authorizing from cache" << url.prettyUrl();
|
||||
curlresult = setupAuth(kioauthinfo.username, kioauthinfo.password);
|
||||
if (curlresult != CURLE_OK) {
|
||||
return curlresult;
|
||||
CURLcode curlresult = curl_easy_perform(m_curl);
|
||||
if (curlresult != CURLE_OK) {
|
||||
const KIO::Error kioerror = curlToKIOError(curlresult, m_curl);
|
||||
if (kioerror == KIO::ERR_COULD_NOT_LOGIN) {
|
||||
if (checkCachedAuthentication(kioauthinfo)) {
|
||||
kDebug(7103) << "Authorizing from cache" << url.prettyUrl();
|
||||
curlresult = setupAuth(kioauthinfo.username, kioauthinfo.password);
|
||||
if (curlresult != CURLE_OK) {
|
||||
return curlresult;
|
||||
}
|
||||
curlresult = curl_easy_perform(m_curl);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
kDebug(7103) << "No cached authorization" << url.prettyUrl();
|
||||
}
|
||||
|
||||
curlresult = curl_easy_perform(m_curl);
|
||||
if (curlresult != CURLE_OK) {
|
||||
const KIO::Error kioerror = curlToKIOError(curlresult, m_curl);
|
||||
if (kioerror == KIO::ERR_COULD_NOT_LOGIN) {
|
||||
|
|
Loading…
Add table
Reference in a new issue