summaryrefslogtreecommitdiff
path: root/ucb
diff options
context:
space:
mode:
authorJulian Kalinowski <julian.kalinowski@dataport.de>2020-06-10 12:54:06 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2020-06-11 10:12:43 +0200
commitdfadae15217465da0c39e363a9a549dd4ee01d1d (patch)
tree9a52a593e970130be9a484bad373564b56acf028 /ucb
parentb73e2b42f09f177fe9ea2daf2aaff576b7f6ad9c (diff)
Fix webdav lock refresh returning 0 instead of true when successful
With commit 58b84caca87c893ac04f0b1399aeadc839a2f075, the NeonSession.LOCK returns "theRetVal" from ne_lock_refresh when successful. But when there is no error, theRetVal will be NE_OK, which is 0, so the method returns false instead of true. This results in lock refresh being stopped after the first refresh, so WebDAV servers will unlock the file after the lock timeouts. Users will see error messages regarding lock timeouts and lost updates are possible. Fix this by adding a return statement when theRetVal == NE_OK. Change-Id: Ie43131fca96e1cfbe932444906b742958a719b26 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96023 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Mike Kaganski <mike.kaganski@collabora.com> (cherry picked from commit 18c6cc0e7a4515b5bd993c425a7e0694bffe1207) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96049 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'ucb')
-rw-r--r--ucb/source/ucp/webdav-neon/NeonSession.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/ucb/source/ucp/webdav-neon/NeonSession.cxx b/ucb/source/ucp/webdav-neon/NeonSession.cxx
index 8ea1db57e5cb..704e20ce039c 100644
--- a/ucb/source/ucp/webdav-neon/NeonSession.cxx
+++ b/ucb/source/ucp/webdav-neon/NeonSession.cxx
@@ -1635,6 +1635,8 @@ bool NeonSession::LOCK( NeonLock * pLock,
= lastChanceToSendRefreshRequest( startCall, pLock->timeout );
SAL_INFO( "ucb.ucp.webdav", "LOCK (refresh) - Lock successfully refreshed." );
+ pLock->timeout = timeout;
+ return true;
}
else
{
@@ -1651,8 +1653,6 @@ bool NeonSession::LOCK( NeonLock * pLock,
}
return false;
}
- pLock->timeout = timeout;
- return theRetVal;
}
void NeonSession::UNLOCK( const OUString & inPath,