diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2023-11-13 10:13:50 +0000 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2023-11-13 13:02:52 +0100 |
commit | 3368447e826d4204086e4d8bfe59af4412c16233 (patch) | |
tree | 924d24fe4e75e62b0965e309fc3a8cacb5f7bef6 /external | |
parent | ef2ca2a87d3071be18a82c96d87a3f8dc17cb872 (diff) |
upgrade libcmis
Change-Id: Ie2d5f3f8208f9952db5be10905b5905cd03b91de
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159366
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'external')
4 files changed, 0 insertions, 257 deletions
diff --git a/external/libcmis/0001-fix-regression-in-HttpSession-initProtocols.patch b/external/libcmis/0001-fix-regression-in-HttpSession-initProtocols.patch deleted file mode 100644 index 8480913cdf20..000000000000 --- a/external/libcmis/0001-fix-regression-in-HttpSession-initProtocols.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 5b9ed18e518a5214b4a1fb2766627c1d169b8d8c Mon Sep 17 00:00:00 2001 -From: Michael Stahl <michael.stahl@allotropia.de> -Date: Mon, 6 Nov 2023 13:33:05 +0100 -Subject: [PATCH 1/2] fix regression in HttpSession::initProtocols() - -(regression from commit 1b8a646b1d63bfa760d154dd7e51f6298d4a9899) ---- - src/libcmis/http-session.cxx | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/src/libcmis/http-session.cxx b/src/libcmis/http-session.cxx -index 3847a2c..9703427 100644 ---- a/src/libcmis/http-session.cxx -+++ b/src/libcmis/http-session.cxx -@@ -894,11 +894,12 @@ catch ( const libcmis::Exception& e ) - - void HttpSession::initProtocols( ) - { -- const unsigned long protocols = CURLPROTO_HTTP | CURLPROTO_HTTPS; - #if (LIBCURL_VERSION_MAJOR > 7) || (LIBCURL_VERSION_MAJOR == 7 && LIBCURL_VERSION_MINOR >= 85) -+ auto const protocols = "https,http"; - curl_easy_setopt(m_curlHandle, CURLOPT_PROTOCOLS_STR, protocols); - curl_easy_setopt(m_curlHandle, CURLOPT_REDIR_PROTOCOLS_STR, protocols); - #else -+ const unsigned long protocols = CURLPROTO_HTTP | CURLPROTO_HTTPS; - curl_easy_setopt(m_curlHandle, CURLOPT_PROTOCOLS, protocols); - curl_easy_setopt(m_curlHandle, CURLOPT_REDIR_PROTOCOLS, protocols); - #endif --- -2.41.0 - diff --git a/external/libcmis/0002-HttpSession-add-a-callback-that-can-be-used-to-confi.patch b/external/libcmis/0002-HttpSession-add-a-callback-that-can-be-used-to-confi.patch deleted file mode 100644 index b47ee4d195b2..000000000000 --- a/external/libcmis/0002-HttpSession-add-a-callback-that-can-be-used-to-confi.patch +++ /dev/null @@ -1,142 +0,0 @@ -From 94012ca5b669e71ea35508159f63576364736dc2 Mon Sep 17 00:00:00 2001 -From: Michael Stahl <michael.stahl@allotropia.de> -Date: Mon, 6 Nov 2023 14:18:59 +0100 -Subject: [PATCH 2/2] HttpSession: add a callback that can be used to configure - libcurl - ---- - inc/libcmis/session-factory.hxx | 7 +++++++ - src/libcmis/http-session.cxx | 8 +++++++- - src/libcmis/http-session.hxx | 8 +++++++- - src/libcmis/session-factory.cxx | 9 ++++++++- - 4 files changed, 29 insertions(+), 3 deletions(-) - -diff --git a/inc/libcmis/session-factory.hxx b/inc/libcmis/session-factory.hxx -index 45abd8b..227ac4d 100644 ---- a/inc/libcmis/session-factory.hxx -+++ b/inc/libcmis/session-factory.hxx -@@ -38,6 +38,9 @@ - #include "libcmis/repository.hxx" - #include "libcmis/session.hxx" - -+// needed for a callback type -+typedef void CURL; -+ - namespace libcmis - { - /** This callback provides the OAuth2 code or NULL. -@@ -80,6 +83,8 @@ namespace libcmis - }; - typedef boost::shared_ptr< CertValidationHandler > CertValidationHandlerPtr; - -+ typedef void(*CurlInitProtocolsFunction)(CURL *); -+ - class LIBCMIS_API SessionFactory - { - private: -@@ -109,6 +114,8 @@ namespace libcmis - static void setCertificateValidationHandler( CertValidationHandlerPtr handler ) { s_certValidationHandler = handler; } - static CertValidationHandlerPtr getCertificateValidationHandler( ) { return s_certValidationHandler; } - -+ static void setCurlInitProtocolsFunction(CurlInitProtocolsFunction); -+ - static void setProxySettings( std::string proxy, - std::string noProxy, - std::string proxyUser, -diff --git a/src/libcmis/http-session.cxx b/src/libcmis/http-session.cxx -index 9703427..8787c50 100644 ---- a/src/libcmis/http-session.cxx -+++ b/src/libcmis/http-session.cxx -@@ -133,8 +133,10 @@ namespace - } - - HttpSession::HttpSession( string username, string password, bool noSslCheck, -- libcmis::OAuth2DataPtr oauth2, bool verbose ) : -+ libcmis::OAuth2DataPtr oauth2, bool verbose, -+ libcmis::CurlInitProtocolsFunction initProtocols) : - m_curlHandle( NULL ), -+ m_CurlInitProtocolsFunction(initProtocols), - m_no100Continue( false ), - m_oauth2Handler( NULL ), - m_username( username ), -@@ -903,6 +905,10 @@ void HttpSession::initProtocols( ) - curl_easy_setopt(m_curlHandle, CURLOPT_PROTOCOLS, protocols); - curl_easy_setopt(m_curlHandle, CURLOPT_REDIR_PROTOCOLS, protocols); - #endif -+ if (m_CurlInitProtocolsFunction) -+ { -+ (*m_CurlInitProtocolsFunction)(m_curlHandle); -+ } - } - - const char* CurlException::what( ) const noexcept -diff --git a/src/libcmis/http-session.hxx b/src/libcmis/http-session.hxx -index 6c9ed1b..34223b2 100644 ---- a/src/libcmis/http-session.hxx -+++ b/src/libcmis/http-session.hxx -@@ -43,6 +43,10 @@ - - class OAuth2Handler; - -+namespace libcmis { -+ typedef void(*CurlInitProtocolsFunction)(CURL *); -+} -+ - class CurlException : public std::exception - { - private: -@@ -93,6 +97,7 @@ class HttpSession - { - protected: - CURL* m_curlHandle; -+ libcmis::CurlInitProtocolsFunction m_CurlInitProtocolsFunction = nullptr; - private: - bool m_no100Continue; - protected: -@@ -111,7 +116,8 @@ class HttpSession - HttpSession( std::string username, std::string password, - bool noSslCheck = false, - libcmis::OAuth2DataPtr oauth2 = libcmis::OAuth2DataPtr(), -- bool verbose = false ); -+ bool verbose = false, -+ libcmis::CurlInitProtocolsFunction = nullptr); - - HttpSession( const HttpSession& copy ); - virtual ~HttpSession( ); -diff --git a/src/libcmis/session-factory.cxx b/src/libcmis/session-factory.cxx -index 1222473..47dc1c8 100644 ---- a/src/libcmis/session-factory.cxx -+++ b/src/libcmis/session-factory.cxx -@@ -38,6 +38,7 @@ using namespace std; - - namespace libcmis - { -+ CurlInitProtocolsFunction g_CurlInitProtocolsFunction = 0; - AuthProviderPtr SessionFactory::s_authProvider; - OAuth2AuthCodeProvider SessionFactory::s_oauth2AuthCodeProvider; - -@@ -48,6 +49,11 @@ namespace libcmis - - CertValidationHandlerPtr SessionFactory::s_certValidationHandler; - -+ void SessionFactory::setCurlInitProtocolsFunction(CurlInitProtocolsFunction const initProtocols) -+ { -+ g_CurlInitProtocolsFunction = initProtocols; -+ } -+ - void SessionFactory::setProxySettings( string proxy, string noProxy, - string proxyUser, string proxyPass ) - { -@@ -81,7 +87,8 @@ namespace libcmis - libcmis::HttpResponsePtr response; - boost::shared_ptr< HttpSession> httpSession( - new HttpSession( username, password, -- noSslCheck, oauth2, verbose ) ); -+ noSslCheck, oauth2, verbose, -+ g_CurlInitProtocolsFunction) ); - - try - { --- -2.41.0 - diff --git a/external/libcmis/0003-HttpSession-fix-regression-setting-wrong-type-of-CUR.patch b/external/libcmis/0003-HttpSession-fix-regression-setting-wrong-type-of-CUR.patch deleted file mode 100644 index 424fd9e0ea0f..000000000000 --- a/external/libcmis/0003-HttpSession-fix-regression-setting-wrong-type-of-CUR.patch +++ /dev/null @@ -1,81 +0,0 @@ -From 3e6eb4cefd22498824247d91ab4c125deb3277da Mon Sep 17 00:00:00 2001 -From: Michael Stahl <michael.stahl@allotropia.de> -Date: Mon, 6 Nov 2023 18:41:37 +0100 -Subject: [PATCH 3/3] HttpSession: fix regression setting wrong type of - CURLOPT_SEEKFUNCTION - -(regression from commit 1b8a646b1d63bfa760d154dd7e51f6298d4a9899) ---- - src/libcmis/http-session.cxx | 28 +++++++++++++++++++++++++--- - 1 file changed, 25 insertions(+), 3 deletions(-) - -diff --git a/src/libcmis/http-session.cxx b/src/libcmis/http-session.cxx -index 8787c50..d7b1a5e 100644 ---- a/src/libcmis/http-session.cxx -+++ b/src/libcmis/http-session.cxx -@@ -31,6 +31,7 @@ - #include <cctype> - #include <memory> - #include <string> -+#include <assert.h> - - #include <libxml/parser.h> - #include <libxml/tree.h> -@@ -110,6 +111,27 @@ namespace - return errCode; - } - -+ int lcl_seekStream(void* data, curl_off_t offset, int origin) -+ { -+ std::ios_base::seekdir dir = {}; -+ switch (origin) -+ { -+ case SEEK_SET: dir = std::ios_base::beg; break; -+ case SEEK_CUR: dir = std::ios_base::cur; break; -+ case SEEK_END: dir = std::ios_base::end; break; -+ default: assert(false); break; -+ } -+ istream& is = *(static_cast<istream*>(data)); -+ is.clear(); -+ is.seekg(offset, dir); -+ if (!is.good()) -+ { -+ fprintf(stderr, "rewind failed\n"); -+ return CURL_SEEKFUNC_FAIL; -+ } -+ return CURL_SEEKFUNC_OK; -+ } -+ - template<typename T> - class ScopeGuard - { -@@ -328,7 +350,7 @@ libcmis::HttpResponsePtr HttpSession::httpPatchRequest( string url, istream& is, - curl_easy_setopt( m_curlHandle, CURLOPT_UPLOAD, 1 ); - curl_easy_setopt( m_curlHandle, CURLOPT_CUSTOMREQUEST, "PATCH" ); - #if (LIBCURL_VERSION_MAJOR > 7) || (LIBCURL_VERSION_MAJOR == 7 && LIBCURL_VERSION_MINOR >= 85) -- curl_easy_setopt( m_curlHandle, CURLOPT_SEEKFUNCTION, lcl_ioctlStream ); -+ curl_easy_setopt( m_curlHandle, CURLOPT_SEEKFUNCTION, lcl_seekStream ); - curl_easy_setopt( m_curlHandle, CURLOPT_SEEKDATA, &isOriginal ); - #else - curl_easy_setopt( m_curlHandle, CURLOPT_IOCTLFUNCTION, lcl_ioctlStream ); -@@ -420,7 +442,7 @@ libcmis::HttpResponsePtr HttpSession::httpPutRequest( string url, istream& is, v - curl_easy_setopt( m_curlHandle, CURLOPT_READFUNCTION, lcl_readStream ); - curl_easy_setopt( m_curlHandle, CURLOPT_UPLOAD, 1 ); - #if (LIBCURL_VERSION_MAJOR > 7) || (LIBCURL_VERSION_MAJOR == 7 && LIBCURL_VERSION_MINOR >= 85) -- curl_easy_setopt( m_curlHandle, CURLOPT_SEEKFUNCTION, lcl_ioctlStream ); -+ curl_easy_setopt( m_curlHandle, CURLOPT_SEEKFUNCTION, lcl_seekStream ); - curl_easy_setopt( m_curlHandle, CURLOPT_SEEKDATA, &isOriginal ); - #else - curl_easy_setopt( m_curlHandle, CURLOPT_IOCTLFUNCTION, lcl_ioctlStream ); -@@ -513,7 +535,7 @@ libcmis::HttpResponsePtr HttpSession::httpPostRequest( const string& url, istrea - curl_easy_setopt( m_curlHandle, CURLOPT_READFUNCTION, lcl_readStream ); - curl_easy_setopt( m_curlHandle, CURLOPT_POST, 1 ); - #if (LIBCURL_VERSION_MAJOR > 7) || (LIBCURL_VERSION_MAJOR == 7 && LIBCURL_VERSION_MINOR >= 85) -- curl_easy_setopt( m_curlHandle, CURLOPT_SEEKFUNCTION, lcl_ioctlStream ); -+ curl_easy_setopt( m_curlHandle, CURLOPT_SEEKFUNCTION, lcl_seekStream ); - curl_easy_setopt( m_curlHandle, CURLOPT_SEEKDATA, &isOriginal ); - #else - curl_easy_setopt( m_curlHandle, CURLOPT_IOCTLFUNCTION, lcl_ioctlStream ); --- -2.41.0 - diff --git a/external/libcmis/UnpackedTarball_libcmis.mk b/external/libcmis/UnpackedTarball_libcmis.mk index 1a1678e5a67c..5e31b8939fcb 100644 --- a/external/libcmis/UnpackedTarball_libcmis.mk +++ b/external/libcmis/UnpackedTarball_libcmis.mk @@ -14,9 +14,6 @@ $(eval $(call gb_UnpackedTarball_set_tarball,libcmis,$(LIBCMIS_TARBALL))) $(eval $(call gb_UnpackedTarball_set_patchlevel,libcmis,1)) $(eval $(call gb_UnpackedTarball_add_patches,libcmis,\ - external/libcmis/0001-fix-regression-in-HttpSession-initProtocols.patch \ - external/libcmis/0002-HttpSession-add-a-callback-that-can-be-used-to-confi.patch \ - external/libcmis/0003-HttpSession-fix-regression-setting-wrong-type-of-CUR.patch \ )) # vim: set noet sw=4 ts=4: |