Bugzilla – Attachment 159997 Details for
Bug 132460
WebDav ephemeral lock timeout negotiation has a feedback-loop
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Fix feedback-loop during WebDAV lock refresh
fix-webdav-feedback-loop.patch (text/plain), 3.00 KB, created by
Jean-Louis Fuchs
on 2020-04-27 14:23:53 UTC
(
hide
)
Description:
Fix feedback-loop during WebDAV lock refresh
Filename:
MIME Type:
Creator:
Jean-Louis Fuchs
Created:
2020-04-27 14:23:53 UTC
Size:
3.00 KB
patch
obsolete
>commit 904b2836b3914696f610789ddd87a1c0f80cc0e7 >Author: Jean-Louis Fuchs <jean-louis.fuchs@adfinis-sygroup.ch> >Date: Fri Mar 27 17:27:51 2020 +0100 > > Fix feedback-loop during WebDAV lock refresh > > Prevent a feedback-loop, where LibreOffice would request a shorter timeout on > each refresh. > > WebDAV servers do not return the lock-timeout the lock was set up with; they > have to return the remaining time. There are WebDAV servers that return a lower > timeout. Two examples [2] [3]. Other servers probably reuse the same timestamp > for the whole request and are therefore not subject to that problem. (This might > even be incorrect if the request takes very long.) > > Updating the lock-timeout with the value returned by the server decreases the > timeout until it reaches zero. > > LibreOffice request SERVER response > LOCK(180) -> LOCK(60) > LOCK(60) -> LOCK(59) > LOCK(59) -> LOCK(58) > ... > 0: no LOCK header -> FAIL > > If we do not update the timeout in NeonSession::LOCK() only the initial setup > updates the timeout. > > LibreOffice request SERVER response > LOCK(180) -> LOCK(60) > LOCK(60) -> LOCK(59) > LOCK(60) -> LOCK(59) > ... > > It is essential that lastChanceToSendRefreshRequest uses the timeout returned by > the server; after it calculated the deadline, we reset the timeout. > > The maintainer of neon confirmed that the timeout should stay the same after the > initial setup. [4]. > > [1] https://tools.ietf.org/html/rfc4918#section-6.6 > [2] https://www.alfresco.com/ > [3] https://github.com/mar10/wsgidav > [4] https://github.com/notroj/neon/issues/12 > >diff --git a/ucb/source/ucp/webdav-neon/NeonSession.cxx b/ucb/source/ucp/webdav-neon/NeonSession.cxx >index c178c1e90238..a1570465617b 100644 >--- a/ucb/source/ucp/webdav-neon/NeonSession.cxx >+++ b/ucb/source/ucp/webdav-neon/NeonSession.cxx >@@ -1624,6 +1624,10 @@ bool NeonSession::LOCK( NeonLock * pLock, > TimeValue startCall; > osl_getSystemTime( &startCall ); > >+ // save the current requested timeout, because ne_lock_refresh uses >+ // pLock->timeout as an out parameter. This prevents a feedback-loop, >+ // where we would request a shorter timeout on each refresh. >+ long timeout = pLock->timeout; > const int theRetVal = ne_lock_refresh(m_pHttpSession, pLock); > if (theRetVal == NE_OK) > { >@@ -1631,7 +1635,6 @@ bool NeonSession::LOCK( NeonLock * pLock, > = lastChanceToSendRefreshRequest( startCall, pLock->timeout ); > > SAL_INFO( "ucb.ucp.webdav", "LOCK (refresh) - Lock successfully refreshed." ); >- return true; > } > else > { >@@ -1648,6 +1651,8 @@ bool NeonSession::LOCK( NeonLock * pLock, > } > return false; > } >+ pLock->timeout = timeout; >+ return lock_result; > } > > void NeonSession::UNLOCK( const OUString & inPath,
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 132460
: 159997