ucb: FTP UCP: report CURLE_URL_MALFORMAT as IllegalIdentifierException
authorMichael Stahl <michael.stahl@allotropia.de>
Wed, 26 Oct 2022 12:58:09 +0000 (14:58 +0200)
committerRene Engelhard <rene@debian.org>
Wed, 9 Nov 2022 16:20:12 +0000 (16:20 +0000)
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>
Gbp-Pq: Name curl-7.86.diff

ucb/source/ucp/ftp/ftpcontent.cxx

index 8e02302ebc4ea507cd190a1f7e721bb6c9975b1c..4c7888e25dc672635ff9a1c440a83b4420531547 100644 (file)
@@ -62,6 +62,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>
@@ -225,6 +226,7 @@ enum ACTION { NOACTION,
               THROWAUTHENTICATIONREQUEST,
               THROWACCESSDENIED,
               THROWINTERACTIVECONNECT,
+              THROWMALFORMED,
               THROWRESOLVENAME,
               THROWQUOTE,
               THROWNOFILE,
@@ -343,6 +345,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;
@@ -537,6 +548,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 ||