[Libreoffice-commits] core.git: ucb/source

Giuseppe Castagno giuseppe.castagno at acca-esse.eu
Fri Aug 26 12:20:29 UTC 2016


 ucb/source/ucp/webdav-neon/NeonSession.cxx |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

New commits:
commit 72589082945e5a197f3fb4b884f48dd4ae275e5f
Author: Giuseppe Castagno <giuseppe.castagno at acca-esse.eu>
Date:   Fri Aug 26 10:03:21 2016 +0200

    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 <ci at libreoffice.org>
    Reviewed-by: Giuseppe Castagno <giuseppe.castagno at acca-esse.eu>

diff --git a/ucb/source/ucp/webdav-neon/NeonSession.cxx b/ucb/source/ucp/webdav-neon/NeonSession.cxx
index 8fdab2f..b3f54e6 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) {


More information about the Libreoffice-commits mailing list