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-03-26 16:39:55 +0100
commit2d832c264801a8b1e155d33d1506af55dc6e207f (patch)
tree859391493e5705267522ba436d5d7b68e095d92d /ucb
parent06072a9707ecebf97758a50255863ee7d3383162 (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. Change-Id: I15685256790375dd86eb1b7614da25838d5ce244
Diffstat (limited to 'ucb')
-rw-r--r--ucb/source/ucp/webdav/SerfLockStore.cxx6
-rw-r--r--ucb/source/ucp/webdav/SerfLockStore.hxx2
-rw-r--r--ucb/source/ucp/webdav/SerfSession.cxx7
3 files changed, 15 insertions, 0 deletions
diff --git a/ucb/source/ucp/webdav/SerfLockStore.cxx b/ucb/source/ucp/webdav/SerfLockStore.cxx
index 183d39303152..2053598317e4 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.
SAL_WARN_IF( !m_aLockInfoMap.empty(), "ucb.ucp.webdav",
@@ -96,6 +98,10 @@ SerfLockStore::~SerfLockStore()
}
}
+bool SerfLockStore::finishing() const
+{
+ return m_bFinishing;
+}
void SerfLockStore::startTicker()
{
diff --git a/ucb/source/ucp/webdav/SerfLockStore.hxx b/ucb/source/ucp/webdav/SerfLockStore.hxx
index 8205a208ee82..a995ced1ed32 100644
--- a/ucb/source/ucp/webdav/SerfLockStore.hxx
+++ b/ucb/source/ucp/webdav/SerfLockStore.hxx
@@ -55,12 +55,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 cff90beb3507..eea964434b09 100644
--- a/ucb/source/ucp/webdav/SerfSession.cxx
+++ b/ucb/source/ucp/webdav/SerfSession.cxx
@@ -352,6 +352,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< security::XCertificateContainer > xCertificateContainer;