diff options
Diffstat (limited to 'ucb')
-rw-r--r-- | ucb/source/ucp/webdav-neon/NeonSession.cxx | 14 | ||||
-rw-r--r-- | ucb/source/ucp/webdav-neon/NeonSession.hxx | 1 | ||||
-rw-r--r-- | ucb/source/ucp/webdav-neon/webdavcontent.cxx | 10 |
3 files changed, 17 insertions, 8 deletions
diff --git a/ucb/source/ucp/webdav-neon/NeonSession.cxx b/ucb/source/ucp/webdav-neon/NeonSession.cxx index 979fb3819406..6d1215b7fe21 100644 --- a/ucb/source/ucp/webdav-neon/NeonSession.cxx +++ b/ucb/source/ucp/webdav-neon/NeonSession.cxx @@ -671,7 +671,8 @@ void NeonSession::Init() { osl::Guard< osl::Mutex > theGuard( m_aMutex ); - bool bCreateNewSession = false; + bool bCreateNewSession = m_bNeedNewSession; + m_bNeedNewSession = false; if ( m_pHttpSession == nullptr ) { @@ -725,13 +726,17 @@ void NeonSession::Init() m_aProxyName = rProxyCfg.aName; m_nProxyPort = rProxyCfg.nPort; + bCreateNewSession = true; + } + + if (bCreateNewSession) + { // new session needed, destroy old first { osl::Guard< osl::Mutex > theGlobalGuard(getGlobalNeonMutex()); ne_session_destroy( m_pHttpSession ); } m_pHttpSession = nullptr; - bCreateNewSession = true; } } @@ -1966,6 +1971,11 @@ void NeonSession::HandleError( int nError, m_aHostName, m_nPort ) ); case NE_AUTH: // User authentication failed on server + // m_pHttpSession could get invalidated, e.g., as result of clean_session called in + // ah_post_send in case when auth_challenge failed, which invalidates the auth_session + // which we established in Init(): the auth_session's sspi_host gets disposed, and + // next attempt to authenticate would crash in continue_sspi trying to dereference it + m_bNeedNewSession = true; throw DAVException( DAVException::DAV_HTTP_AUTH, NeonUri::makeConnectionEndPointString( m_aHostName, m_nPort ) ); diff --git a/ucb/source/ucp/webdav-neon/NeonSession.hxx b/ucb/source/ucp/webdav-neon/NeonSession.hxx index 2adebaacd3fd..df4522da6e18 100644 --- a/ucb/source/ucp/webdav-neon/NeonSession.hxx +++ b/ucb/source/ucp/webdav-neon/NeonSession.hxx @@ -54,6 +54,7 @@ private: sal_Int32 m_nProxyPort; css::uno::Sequence< css::beans::NamedValue > const m_aFlags; HttpSession * m_pHttpSession; + bool m_bNeedNewSession = false; // Something happened that could invalidate m_pHttpSession void * const m_pRequestData; const ucbhelper::InternetProxyDecider & m_rProxyDecider; diff --git a/ucb/source/ucp/webdav-neon/webdavcontent.cxx b/ucb/source/ucp/webdav-neon/webdavcontent.cxx index 7a376f48fcfa..8ef0956b2eff 100644 --- a/ucb/source/ucp/webdav-neon/webdavcontent.cxx +++ b/ucb/source/ucp/webdav-neon/webdavcontent.cxx @@ -1586,12 +1586,10 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( if ( eType == DAV ) { - //xProps.reset( - // new ContentProperties( aUnescapedTitle ) ); - xProps->addProperty( - "Title", - uno::makeAny( aUnescapedTitle ), - true ); + if (!xProps) + xProps.reset(new ContentProperties(aUnescapedTitle)); + else + xProps->addProperty("Title", uno::makeAny(aUnescapedTitle), true); } else { |