From 72589082945e5a197f3fb4b884f48dd4ae275e5f Mon Sep 17 00:00:00 2001 From: Giuseppe Castagno Date: Fri, 26 Aug 2016 10:03:21 +0200 Subject: tdf#101094 (27): Add a mutex guard to OPTIONS neon dispatch calls This is a sort of follow up to commit: 510da29131e56ba0e1783e505e7131e6f7e0d6b4: "forced to make certain neon api calls thread-safe due to cups rhbz#637738 libgcrypt that's been initialized already by cups to be non-threadsafe is therefore then also non-threadsafe. neon uses libgcrypt. So in the (as this is the usual circumstance) case that cups is initialized before neon, then libgcrypt is not threadsafe even though neon attempt to initialize it as such." Change-Id: I1f868642ac15bf9fa25d3edd46390467d8fce1f5 Reviewed-on: https://gerrit.libreoffice.org/28401 Tested-by: Jenkins Reviewed-by: Giuseppe Castagno --- ucb/source/ucp/webdav-neon/NeonSession.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'ucb') diff --git a/ucb/source/ucp/webdav-neon/NeonSession.cxx b/ucb/source/ucp/webdav-neon/NeonSession.cxx index 8fdab2feaa21..b3f54e6fa4fe 100644 --- a/ucb/source/ucp/webdav-neon/NeonSession.cxx +++ b/ucb/source/ucp/webdav-neon/NeonSession.cxx @@ -845,18 +845,19 @@ void NeonSession::OPTIONS( const OUString & inPath, const DAVRequestEnvironment & rEnv ) throw( std::exception ) { - - osl::Guard< osl::Mutex > theGuard( m_aMutex ); SAL_INFO( "ucb.ucp.webdav", "OPTIONS - relative URL <" << inPath << ">" ); rOptions.reset(); Init( rEnv ); + int theRetVal; ne_request *req = ne_request_create(m_pHttpSession, "OPTIONS", OUStringToOString( inPath, RTL_TEXTENCODING_UTF8 ).getStr()); - - int theRetVal = ne_request_dispatch(req); + { + osl::Guard< osl::Mutex > theGlobalGuard( aGlobalNeonMutex ); + theRetVal = ne_request_dispatch(req); + } //check if http error is in the 200 class (no error) if (theRetVal == NE_OK && ne_get_status(req)->klass != 2) { -- cgit