diff options
author | Michael Stahl <michael.stahl@allotropia.de> | 2022-10-26 14:58:09 +0200 |
---|---|---|
committer | Michael Stahl <michael.stahl@allotropia.de> | 2022-10-26 16:02:25 +0200 |
commit | 022e476af44c0dfc97403dc0f3a3b63e731903e6 (patch) | |
tree | 649300fd65f622439ab6506e0b74f5f792ce85fc /ucb | |
parent | d86a5a44d12daf0ea3d4865613679ca97fe7739a (diff) |
ucb: FTP UCP: report CURLE_URL_MALFORMAT as IllegalIdentifierException
With curl 7.86, the test JunitTest_ucb_complex starts to fail:
.ftp://noname:nopasswd@*nohost.invalid
now executing open
com.sun.star.ucb.InteractiveAugmentedIOException:
at com.sun.proxy.$Proxy15.execute(Unknown Source)
at complex.ucb.UCB.executeCommand(UCB.java:63)
at complex.ucb.UCB.checkWrongFtpConnection(UCB.java:119)
because curl_easy_perform() now returns CURLE_URL_MALFORMAT where
previously it was CURLE_COULDNT_RESOLVE_HOST.
Map this to an exception the test expects.
Change-Id: Ifdb672946726ddb4cb4d9426b7e70eefac63f040
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141877
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'ucb')
-rw-r--r-- | ucb/source/ucp/ftp/ftpcontent.cxx | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/ucb/source/ucp/ftp/ftpcontent.cxx b/ucb/source/ucp/ftp/ftpcontent.cxx index 0294cea7b9f8..65e2b86f8f21 100644 --- a/ucb/source/ucp/ftp/ftpcontent.cxx +++ b/ucb/source/ucp/ftp/ftpcontent.cxx @@ -63,6 +63,7 @@ #include <com/sun/star/ucb/UnsupportedDataSinkException.hpp> #include <com/sun/star/ucb/OpenCommandArgument2.hpp> #include <com/sun/star/ucb/UnsupportedOpenModeException.hpp> +#include <com/sun/star/ucb/IllegalIdentifierException.hpp> #include <com/sun/star/ucb/InteractiveNetworkConnectException.hpp> #include <com/sun/star/ucb/InteractiveNetworkResolveNameException.hpp> #include <com/sun/star/ucb/InteractiveIOException.hpp> @@ -226,6 +227,7 @@ enum ACTION { NOACTION, THROWAUTHENTICATIONREQUEST, THROWACCESSDENIED, THROWINTERACTIVECONNECT, + THROWMALFORMED, THROWRESOLVENAME, THROWQUOTE, THROWNOFILE, @@ -344,6 +346,15 @@ Any SAL_CALL FTPContent::execute( const Command& aCommand, Environment); break; } + case THROWMALFORMED: + { + IllegalIdentifierException ex; + aRet <<= ex; + ucbhelper::cancelCommandExecution( + aRet, + Environment); + break; + } case THROWRESOLVENAME: { InteractiveNetworkResolveNameException excep; @@ -538,6 +549,10 @@ Any SAL_CALL FTPContent::execute( const Command& aCommand, { if(e.code() == CURLE_COULDNT_CONNECT) action = THROWINTERACTIVECONNECT; + else if (e.code() == CURLE_URL_MALFORMAT) + { + action = THROWMALFORMED; + } else if(e.code() == CURLE_COULDNT_RESOLVE_HOST ) action = THROWRESOLVENAME; else if(e.code() == CURLE_FTP_USER_PASSWORD_INCORRECT || |