kioslave: disable PASV based on value from kio_ftprc in curl slave

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2024-03-17 22:06:04 +02:00
parent 7c31e18dcf
commit 0c10290cf2

View file

@ -20,6 +20,7 @@
#include "kcomponentdata.h"
#include "kmimetype.h"
#include "kremoteencoding.h"
#include "kconfiggroup.h"
#include "kdebug.h"
#include <QApplication>
@ -795,6 +796,17 @@ bool CurlProtocol::setupCurl(const KUrl &url)
}
}
if (m_isftp || m_issftp) {
// NOTE: this is stored in kio_ftprc
const long disablepassivemode = config()->readEntry("DisablePassiveMode", false);
kDebug(7103) << "Disable passive mode" << disablepassivemode;
curlresult = curl_easy_setopt(m_curl, CURLOPT_FTP_SKIP_PASV_IP, disablepassivemode);
if (curlresult != CURLE_OK) {
KIO_CURL_ERROR(curlresult);
return false;
}
}
return true;
}