Kaydet (Commit) 72589082 authored tarafından Giuseppe Castagno's avatar Giuseppe Castagno

tdf#101094 (27): Add a mutex guard to OPTIONS neon dispatch calls

This is a sort of follow up to commit:
510da291:

"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/28401Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarGiuseppe Castagno <giuseppe.castagno@acca-esse.eu>
üst 2c2f0eaf
...@@ -845,18 +845,19 @@ void NeonSession::OPTIONS( const OUString & inPath, ...@@ -845,18 +845,19 @@ void NeonSession::OPTIONS( const OUString & inPath,
const DAVRequestEnvironment & rEnv ) const DAVRequestEnvironment & rEnv )
throw( std::exception ) throw( std::exception )
{ {
osl::Guard< osl::Mutex > theGuard( m_aMutex );
SAL_INFO( "ucb.ucp.webdav", "OPTIONS - relative URL <" << inPath << ">" ); SAL_INFO( "ucb.ucp.webdav", "OPTIONS - relative URL <" << inPath << ">" );
rOptions.reset(); rOptions.reset();
Init( rEnv ); Init( rEnv );
int theRetVal;
ne_request *req = ne_request_create(m_pHttpSession, "OPTIONS", OUStringToOString( ne_request *req = ne_request_create(m_pHttpSession, "OPTIONS", OUStringToOString(
inPath, RTL_TEXTENCODING_UTF8 ).getStr()); 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) //check if http error is in the 200 class (no error)
if (theRetVal == NE_OK && ne_get_status(req)->klass != 2) { if (theRetVal == NE_OK && ne_get_status(req)->klass != 2) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment