summaryrefslogtreecommitdiff
path: root/ucb
AgeCommit message (Collapse)AuthorFilesLines
2020-10-05Removed duplicated includeAndrea Gelmini1-1/+0
Change-Id: Ib3fb174f390424f765113a7565a8b87dbede7342 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103938 Tested-by: Jenkins Reviewed-by: Andrea Gelmini <andrea.gelmini@gelma.net>
2020-10-04use more TOOLS_WARN_EXCEPTIONMike Kaganski11-96/+91
Change-Id: I269f88d82680f6a969a8bf582f0ae00cc7636509 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103925 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-10-04loplugin:reducevarscope in toolkit..unotoolsNoel4-12/+10
Change-Id: I439b9f456ac0bfaa3eb9bf17472053bd4787e828 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103840 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-10-03use more TOOLS_WARN_EXCEPTIONNoel3-4/+7
Change-Id: I8b5cde993c13e0b7c8c830b1ff698933a6b7cfd0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103863 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-10-02Use the new single-instance="true" attribute in ucbStephan Bergmann17-45/+30
Change-Id: I7eb38f0da1d88fd0f7ca4a1054546617b10a3502 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103843 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-10-01Use the new single-instance="true" attribute in ucbStephan Bergmann9-92/+16
It looks like 3d44c6a49b20415616dab7a2de2820da5efab309 "ucb/core: create instances with uno constructors" mixed up com.sun.star.comp.ucb.UcbPropertiesManager (which had originally been implemented with the single-instance cppu::createOneInstanceFactory) and com.sun.star.comp.ucb.SimpleFileAccess (which had originally been implemented with the multi-instance cppu::createSingleFactory), using a static g_Instance in the C++ constructor function of the former but adding a fake <singleton> to the *.component <implementation> of the latter. Change-Id: Ida7cb242a73fbe7689094e239ffe0c0291cf1d3c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103738 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-09-27Remove unused include list in ucb/cmis_contentJulien Nabet1-2/+0
Change-Id: I7c554e883691e2f97e2f48b2a0353dfa9d4d84d5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103507 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2020-09-22OUStringLiteral/OStringLiteral coverity PARSE_ERROR workaroundCaolán McNamara1-15/+15
do more like commit 121771e37f7e2de41cd5643475861062bf25627b Date: Mon Sep 21 09:17:54 2020 +0200 Make some OUStringLiteral vars constexpr cause coverity can live with that Change-Id: I9efd7f848289c4865997a44c6780373068422227 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103147 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-16Turn OUStringLiteral into a consteval'ed, static-refcound rtl_uStringStephan Bergmann7-35/+27
...from which an OUString can cheaply be instantiated. This is the OUString equivalent of 4b9e440c51be3e40326bc90c33ae69885bfb51e4 "Turn OStringLiteral into a consteval'ed, static-refcound rtl_String". Most remarks about that commit apply here too (this commit is just substantially bigger and a bit more complicated because there were so much more uses of OUStringLiteral than of OStringLiteral): The one downside is that OUStringLiteral now needs to be a template abstracting over the string length. But any uses for which that is a problem (e.g., as the element type of a container that would no longer be homogeneous, or in the signature of a function that shall not be turned into a template for one reason or another) can be replaced with std::u16string_view, without loss of efficiency compared to the original OUStringLiteral, and without loss of expressivity. The new OUStringLiteral ctor code would probably not be very efficient if it were ever executed at runtime, but it is intended to be only executed at compile time. Where available, C++20 "consteval" is used to statically ensure that. The intended use of the new OUStringLiteral is in all cases where an object that shall itself not be an OUString (e.g., because it shall be a global static variable for which the OUString ctor/dtor would be detrimental at library load/unload) must be converted to an OUString instance in at least one place. Other string literal abstractions could use std::u16string_view (or just plain char16_t const[N]), but interestingly OUStringLiteral might be more efficient than constexpr std::u16string_view even for such cases, as it should not need any relocations at library load time. For now, no existing uses of OUStringLiteral have been changed to some other abstraction (unless technically necessary as discussed above), and no additional places that would benefit from OUStringLiteral have been changed to use it. Global constexpr OUStringLiteral variables defined in an included file would be somewhat suboptimal, as each translation unit that uses them would create its own, unshared instance. The envisioned solution is to turn them into static data members of some class (and there may be a loplugin coming to find and fix affected places). Another approach that has been taken here in a few cases where such variables were only used in one .cxx anyway is to move their definitions from the .hxx into that one .cxx (in turn causing some files to become empty and get removed completely)---which also silenced some GCC -Werror=unused-variable if a variable from a .hxx was not used in some .cxx including it. To keep individual commits reasonably manageable, some consumers of OUStringLiteral in rtl/ustrbuf.hxx and rtl/ustring.hxx are left in a somewhat odd state for now, where they don't take advantage of OUStringLiteral's equivalence to rtl_uString, but just keep extracting its contents and copy it elsewhere. In follow-up commits, those consumers should be changed appropriately, making them treat OUStringLiteral like an rtl_uString or dropping the OUStringLiteral overload in favor of an existing (and cheap to use now) OUString overload, etc. In a similar vein, comparison operators between OUString and std::u16string_view have been added to the existing plethora of comparison operator overloads. It would be nice to eventually consolidate them, esp. with the overloads taking OUStringLiteral and/or char16_t const[N] string literals, but that appears tricky to get right without introducing new ambiguities. Also, a handful of places across the code base use comparisons between OUString and OUStringNumber, which are now ambiguous (converting the OUStringNumber to either OUString or std::u16string_view). For simplicity, those few places have manually been fixed for now by adding explicit conversion to std::u16string_view. Also some compilerplugins code needed to be adapted, and some of the compilerplugins/test cases have become irrelevant (and have been removed), as the tested code would no longer compile in the first place. sal/qa/rtl/strings/test_oustring_concat.cxx documents a workaround for GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96878> "Failed class template argument deduction in unevaluated, parenthesized context". That place, as well as uses of OUStringLiteral in extensions/source/abpilot/fieldmappingimpl.cxx and i18npool/source/localedata/localedata.cxx, which have been replaced with OUString::Concat (and which is arguably a better choice, anyway), also caused failures with at least Clang 5.0.2 (but would not have caused failures with at least recent Clang 12 trunk, so appear to be bugs in Clang that have meanwhile been fixed). Change-Id: I34174462a28f2000cfeb2d219ffd533a767920b8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102222 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-09-01Fix typo in codeAndrea Gelmini1-11/+11
It passed "make check" on linux Change-Id: I8322ecf2a4c960524fd45cd63fd991d9fa0a3590 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101796 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2020-09-01Fix typoAndrea Gelmini1-1/+1
Change-Id: I03dc9ad3ad496524efbbb2f1a48f76fb95d1bfc5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101781 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2020-08-30Goodbye O[U]StringView, welcome O[U]String::ConcatStephan Bergmann1-1/+1
O[U]StringView had an odd mixture of uses. For one, it was used like std::[u16]string_view, for which directly using the latter std types is clearly the better alternative. For another, it was used in concatenation sequences, when neither of the two leading terms were of our rtl string-related types. For that second use case introduce O[U]String::Concat (as std::[u16]string_view can obviously not be used, those not being one of our rtl string-related types). Also, O[U]StringLiteral is occasionally used for this, but the planned changes outlined in the 33ecd0d5c4fff9511a8436513936a3f7044a775a "Change OUStringLiteral from char[] to char16_t[]" commit message will make that no longer work, so O[U]String::Concat will be the preferred solution in such use cases going forward, too. O[U]StringView was also occasionally used to include O[U]StringBuffer values in concatenation sequences, for which a more obvious alternative is to make O[U]StringBuffer participate directly in the ToStringHelper/O[U]StringConcat machinery. Change-Id: I1f0e8d836796c9ae01c45f32c518be5f52976622 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101586 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-08-29Fix typosAndrea Gelmini6-6/+6
Change-Id: I473956d570feac508e52a3e52cc26cc154f4dc56 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101627 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins
2020-08-28Change OUStringLiteral from char[] to char16_t[]Stephan Bergmann6-49/+52
This is a prerequisite for making conversion from OUStringLiteral to OUString more efficient at least for C++20 (by replacing its internals with a constexpr- generated sal_uString-compatible layout with a SAL_STRING_STATIC_FLAG refCount, conditionally for C++20 for now). For a configure-wise bare-bones build on Linux, size reported by `du -bs instdir` grew by 118792 bytes from 1155636636 to 1155755428. In most places just a u"..." string literal prefix had to be added. In some places char const a[] = "..."; variables have been changed to char16_t, and a few places required even further changes to code (which prompted the addition of include/o3tl/string_view.hxx helper function o3tl::equalsIgnoreAsciiCase and the additional OUString::createFromAscii overload). For all uses of macros expanding to string literals, the relevant uses have been rewritten as u"" MACRO instead of changing the macro definitions. It should be possible to change at least some of those macro definitions (and drop the u"" from their call sites) in follow-up commits. Change-Id: Iec4ef1a057d412d22443312d40c6a8a290dc6144 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101483 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-08-21Fix typosAndrea Gelmini2-2/+2
Change-Id: Iaf1d4aed07d1e6fcfe2392fb65cbd2fa196bcc1c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101099 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2020-08-16loplugin:unusedmethodsNoel Grandin15-15/+0
Change-Id: I2dd10873be73256a3689233c7b1e37bde8f685ee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100820 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-14loplugin:simplifybool moreNoel Grandin1-1/+1
look for expressions like !(a && !b) which can be expanded out Change-Id: I72515a9638762b050f9a258c08da39ebfa2ef8e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100579 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-13loplugin:stringstatic also look for local staticsNoel Grandin2-37/+36
Add some API to O*StringLiteral, to make it easier to use in some places that were using O*String Change-Id: I1fb93bd47ac2065c9220d509aad3f4320326d99e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100270 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-11Expand XSERVICEINFO_COMMOM_IMPL macro which is now used only onceJulien Nabet1-2/+19
Change-Id: I32de3f604cbb6863e29c0a63b599920a988c8389 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100463 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2020-08-11Heap use-after-freeStephan Bergmann2-24/+5
...as seen during UITest_writer_tests2: > ==2548829==ERROR: AddressSanitizer: heap-use-after-free on address 0x60b0002be9d0 at pc 0x7f42be5ddc7f bp 0x7ffe2d26b090 sp 0x7ffe2d26b088 > READ of size 1 at 0x60b0002be9d0 thread T0 > #0 in cppu::WeakComponentImplHelperBase::release() at cppuhelper/source/implbase.cxx:84:9 > #1 in cppu::PartialWeakComponentImplHelper<com::sun::star::lang::XServiceInfo, com::sun::star::beans::XPropertySetInfo>::release() at include/cppuhelper/compbase.hxx:86:36 > #2 in rtl::Reference<UcbPropertiesManager>::~Reference() at include/rtl/ref.hxx:113:22 > #3 in __run_exit_handlers at /usr/src/debug/glibc-2.31-48-g64246fccaf/stdlib/exit.c:108:8 > #4 in exit at /usr/src/debug/glibc-2.31-48-g64246fccaf/stdlib/exit.c:139:3 > #5 in __libc_start_main at /usr/src/debug/glibc-2.31-48-g64246fccaf/csu/../csu/libc-start.c:342:3 > 0x60b0002be9d0 is located 64 bytes inside of 112-byte region [0x60b0002be990,0x60b0002bea00) > freed by thread T0 here: > #0 in free at /home/sbergman/github.com/llvm/llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:123:3 > #1 in rtl_freeMemory at sal/rtl/alloc_global.cxx:51:5 > #2 in cppu::WeakComponentImplHelperBase::operator delete(void*) at include/cppuhelper/compbase_ex.hxx:66:11 > #3 in UcbPropertiesManager::~UcbPropertiesManager() at ucb/source/core/ucbprops.cxx:197:1 > #4 in cppu::OWeakObject::release() at cppuhelper/source/weak.cxx:233:9 > #5 in cppu::WeakComponentImplHelperBase::release() at cppuhelper/source/implbase.cxx:86:18 > #6 in cppu::PartialWeakComponentImplHelper<com::sun::star::lang::XServiceInfo, com::sun::star::beans::XPropertySetInfo>::release() at include/cppuhelper/compbase.hxx:86:36 > #7 in rtl::Reference<UcbPropertiesManager>::clear() at include/rtl/ref.hxx:180:19 > #8 in UcbPropertiesManager::dispose() at ucb/source/core/ucbprops.cxx:205:16 > #9 in cppu::WeakComponentImplHelperBase::release() at cppuhelper/source/implbase.cxx:79:13 > #10 in cppu::PartialWeakComponentImplHelper<com::sun::star::lang::XServiceInfo, com::sun::star::beans::XPropertySetInfo>::release() at include/cppuhelper/compbase.hxx:86:36 > #11 in rtl::Reference<UcbPropertiesManager>::~Reference() at include/rtl/ref.hxx:113:22 > #12 in __run_exit_handlers at /usr/src/debug/glibc-2.31-48-g64246fccaf/stdlib/exit.c:108:8 The elaborate g_Instance disposal scheme had been introduced with 3d44c6a49b20415616dab7a2de2820da5efab309 "ucb/core: create instances with uno constructors", but it is unclear to me for what reason. Change-Id: I768bc3a8674e0e81cf89adae58e4a67d14509985 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100456 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-08-09ucb/core: create instances with uno constructorsNoel Grandin15-371/+213
See tdf#74608 for motivation. Change-Id: Ieabf6d417a482ea7cc17e78a78954687e8894cb1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98801 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-03loplugin:flatten in ucbNoel Grandin20-850/+846
Change-Id: Ica7e5d3b5a5cec065f35f99d62b3b6604323601a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100009 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-07-23ucb/gio: create instances with uno constructorsNoel Grandin3-49/+22
See tdf#74608 for motivation. Change-Id: I8e20d9800d9446a42e1e2baed51f650b324cc248 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99267 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-07-22ucb/ftp: create instances with uno constructorsNoel Grandin5-99/+13
See tdf#74608 for motivation. Change-Id: Ic71294b1fb2afd1726e0c5948d6f088b7cdac964 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99222 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-07-22ucb/package: create instances with uno constructorsNoel Grandin5-88/+21
See tdf#74608 for motivation. Change-Id: Id93f1e18d6646e3747443678bf3d56fa75cb46ce Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99223 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-07-22ucb/file: create instances with uno constructorsNoel Grandin5-78/+11
See tdf#74608 for motivation. Change-Id: I1650f042a87d7351a126c0701cce8b2e12829461 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99221 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-07-22ucb/neon: create instances with uno constructorsNoel Grandin5-99/+18
See tdf#74608 for motivation. Change-Id: Ia86a4cc06819ce5820ab44d293790f7bd9a03711 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99224 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-07-22ucb/ext: create instances with uno constructorsNoel Grandin5-87/+14
See tdf#74608 for motivation. Change-Id: Ie2e0958e181db002d747bffd05ead02bebd96956 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99220 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-07-22ucb/expand: create instances with uno constructorsNoel Grandin2-48/+12
See tdf#74608 for motivation. Change-Id: I83f75a1d107a74c1c9707243caf323b630f0b33f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99178 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-07-22ucb/sorter: create instances with uno constructorsNoel Grandin5-100/+12
See tdf#74608 for motivation. Change-Id: I6d9b20e281238038f9eed1578a64316857cf6247 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99176 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-07-22ucb/cmis: create instances with uno constructorsNoel Grandin3-48/+15
See tdf#74608 for motivation. Change-Id: I5bf06ba3d9bac04d18e6b9338a20030cb4a42c89 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99177 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-07-16ucb/hierarchy: create instances with uno constructorsNoel Grandin7-127/+33
See tdf#74608 for motivation. Change-Id: I6c57cf814af386bfb2c2c035d32175c4ff9ef7a4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98874 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-07-16loplugin:unusedmethodsNoel Grandin1-4/+0
Change-Id: Ibc1ec64cba8eb083aaff28848a42337cc597ea19 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98857 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-07-15ucb/cacher: create instances with uno constructorsNoel Grandin11-215/+65
See tdf#74608 for motivation. Change-Id: I56261af8f540c214419e01b81c789cb6a4c31d31 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98747 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-07-13expand out an UNO macroNoel Grandin15-15/+148
to make the ongoing convert-to-UNO-constructor work easier Change-Id: I99596561832b10538505cf4dfdabaf11d6e4d7cb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98664 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-07-13ucb/tdoc: create instances with uno constructorsNoel Grandin7-146/+36
See tdf#74608 for motivation. Change-Id: I669e3b35dd692b974c040b5d076d18f710d5cc28 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98663 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-07-10replace usage of blacklist with excludelist for IWYUThorsten Behrens1-1/+1
Background and motivation: https://tools.ietf.org/html/draft-knodel-terminology-02 Change-Id: I2f22d455d2a936a85750eaab1fda215ebb6d9d48 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98182 Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2020-07-02Upcoming improved loplugin:staticanonymous -> redundantstatic: ucbStephan Bergmann6-35/+35
Change-Id: Id9301e65bea34c0edd9aadab85b848117e05075e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97710 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-06-12tdf#133673 fix webdav lock refresh with Auth:NegotiateJulian Kalinowski1-2/+0
NeonSession::NeonAuth requires an AuthListener to be set in the RequestEnvironment (RE). After a HTTP 401, the Negotiate challenge should be handled. The whole RE however is reset in HandleError, which is called after every request. Usually, this is not a problem because the RE is re-set at the beginning of almost all requests (PUT, GET, PROPFIND, ...). But when refreshing locks this is not the case, as the LockStore does not know any RequestEnvironment. NeonSession::NeonAuth is then called in a post-send hook after a HTTP 401, the AuthListener is null and in consequence Neon's ah_post_send does not return NE_RETRY. So there will be no retry with the correct authorization header. This patch removes the reset of the RequestEnvironment in HandleError, thus keeping it in the session for further use. Change-Id: Ib1a5eff08072f9ef003e760c5f40d9ad26c6cad1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96191 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-06-10Fix webdav lock refresh returning 0 instead of true when successfulJulian Kalinowski1-2/+2
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>
2020-06-05Upcoming loplugin:elidestringvar: ucbStephan Bergmann2-11/+8
Change-Id: I25535b844b6fa12679908427997713dadf819d74 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95588 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-06-02inline some use-once typedefsNoel Grandin1-3/+1
Change-Id: I335e0c5cf7944efa487e4535a9e6a5baab2f36dd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95140 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-31neon: upgrade to release 0.31.1Jan-Marek Glogowski1-0/+1
Drops some of the LO patches upstreamed since 0.31.0. Version 0.31.0 introduced an new session flag for MS SharePoint compatibility, NE_SESSFLAG_SHAREPOINT, which enables a few workarounds, where SharePoint breaks the WebDAV RFCs. In 0.31.1 a compiler warning and the MD5 ABI break introduced in 0.31.0 are fixed, so LO can now update neon. Change-Id: Ia79ce530271664c0e6bab30a5e2516319da328d8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91070 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2020-05-29loplugin:simplifybool in ucb..vclNoel Grandin1-2/+1
Change-Id: Ib63623f5ca3f6559e02a0013c3cbd6174f7aec14 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95108 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-21use for-range on Sequence in testtools..xmloffNoel Grandin1-4/+3
Change-Id: I05b02a2f8b4b9091c7de0f7e98409d5b608ed250 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94610 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-13Fix syntax errors in --with-webdav=serf codeStephan Bergmann6-9/+9
...introduced with de61e14d0b6ee90cb4d170af340275d811b9fbbf "compact namespace in ucb..uui" Change-Id: I58e24303e1e12db0a53d46acc2daef1faa2e4cf6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94128 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-05-10compact namespace in ucb..uuiNoel Grandin31-79/+79
Change-Id: I644d5e418028b4b4e66cf67b20a1155a689acab0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93906 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-10new loplugin:simplifypointertoboolNoel Grandin1-1/+1
Change-Id: Iff68e8f379614a6ab6a6e0d1bad18e70bc76d76a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91907 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-04-29tdf#132460 Fix feedback-loop during WebDAV lock refreshJean-Louis Fuchs1-1/+6
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 Change-Id: Ie76338f7a88f41f47569a62ea6efec8c6f646f50 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92981 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-04-24Typo: surf->serfJulien Nabet1-1/+1
Change-Id: I1aba26d5495f7b1c158c432dc6e92f56f4453160 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92880 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Jenkins