summaryrefslogtreecommitdiff
path: root/ucb
diff options
context:
space:
mode:
authorMatúš Kukan <matus.kukan@collabora.com>2014-03-26 16:17:21 +0100
committerMatúš Kukan <matus.kukan@collabora.com>2014-04-02 15:35:35 +0200
commit18df3732dee6d6d6215ddfc2f8f999a65bd14d6b (patch)
tree2b070a65c7f8c5dc145e1b222c51879934e23646 /ucb
parentdc3cd43dbb14f2e23f9406da21b546daefd384c7 (diff)
webdav: Workaround failing unlocking by ignoring certificates when closing.
In neon version, we use xml::crypto::SEInitializer in NeonSession_CertificationNotify which I see called only once. For some reason in serf, Serf_ConnectSetup is called every time we send a command to the server. But that leads to not working verifySerfCertificateChain in __run_exit_handlers because xml::crypto::SEInitializer is not available anymore. (cherry picked from commit 2d832c264801a8b1e155d33d1506af55dc6e207f) Conflicts: ucb/source/ucp/webdav/SerfLockStore.cxx Change-Id: I15685256790375dd86eb1b7614da25838d5ce244
Diffstat (limited to 'ucb')
-rw-r--r--ucb/source/ucp/webdav/SerfLockStore.cxx8
-rw-r--r--ucb/source/ucp/webdav/SerfLockStore.hxx2
-rw-r--r--ucb/source/ucp/webdav/SerfSession.cxx7
3 files changed, 16 insertions, 1 deletions
diff --git a/ucb/source/ucp/webdav/SerfLockStore.cxx b/ucb/source/ucp/webdav/SerfLockStore.cxx
index 7a0795bcdcd1..514c13fbfd82 100644
--- a/ucb/source/ucp/webdav/SerfLockStore.cxx
+++ b/ucb/source/ucp/webdav/SerfLockStore.cxx
@@ -75,6 +75,7 @@ void TickerThread::run()
// -------------------------------------------------------------------
SerfLockStore::SerfLockStore()
: m_pTickerThread( 0 )
+ , m_bFinishing( false )
{
}
@@ -82,6 +83,7 @@ SerfLockStore::SerfLockStore()
SerfLockStore::~SerfLockStore()
{
stopTicker();
+ m_bFinishing = true;
// release active locks, if any.
OSL_ENSURE( m_aLockInfoMap.size() == 0,
@@ -97,7 +99,11 @@ SerfLockStore::~SerfLockStore()
}
}
-// -------------------------------------------------------------------
+bool SerfLockStore::finishing() const
+{
+ return m_bFinishing;
+}
+
void SerfLockStore::startTicker()
{
osl::MutexGuard aGuard( m_aMutex );
diff --git a/ucb/source/ucp/webdav/SerfLockStore.hxx b/ucb/source/ucp/webdav/SerfLockStore.hxx
index eefd7b838a74..0444359e2afd 100644
--- a/ucb/source/ucp/webdav/SerfLockStore.hxx
+++ b/ucb/source/ucp/webdav/SerfLockStore.hxx
@@ -56,12 +56,14 @@ class SerfLockStore
{
osl::Mutex m_aMutex;
TickerThread * m_pTickerThread;
+ bool m_bFinishing;
LockInfoMap m_aLockInfoMap;
public:
SerfLockStore();
~SerfLockStore();
+ bool finishing() const;
OUString getLockToken( const OUString& rLock );
void addLock( const OUString& rLock,
diff --git a/ucb/source/ucp/webdav/SerfSession.cxx b/ucb/source/ucp/webdav/SerfSession.cxx
index 3f024cb69e02..938c61056eaf 100644
--- a/ucb/source/ucp/webdav/SerfSession.cxx
+++ b/ucb/source/ucp/webdav/SerfSession.cxx
@@ -348,6 +348,13 @@ apr_status_t SerfSession::verifySerfCertificateChain (
return SERF_SSL_CERT_UNKNOWN_FAILURE;
}
+ // When called from SerfLockStore::~SerfLockStore(),
+ // css::xml::crypto::SEInitializer::create() will fail
+ // but we want to send unlock commands anyway,
+ // so just ignore certificates and return here.
+ if (apr_environment::AprEnv::getAprEnv()->getSerfLockStore()->finishing())
+ return APR_SUCCESS;
+
// Create some crypto objects to decode and handle the base64
// encoded certificate chain.
uno::Reference< xml::crypto::XSEInitializer > xSEInitializer;