Commit graph

135 commits

Author SHA1 Message Date
Tor Lillqvist
29b603a34f Fix build for MOBILEAPP
No Admin.hpp needed (which would cause a conflicting definitions of a
class called Document when compiling Kit.cpp).

No locks "supported" in the way the code expects for WOPI-like things.

Change-Id: Ie43311af054f2940576ce9b2b13520f24887628e
Reviewed-on: https://gerrit.libreoffice.org/84018
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Tor Lillqvist <tml@collabora.com>
2019-11-29 12:12:30 +01:00
Michael Meeks
0d97efbfcc locking: renew lock after timeout.
Change-Id: I6191ee34239b978292aeb6795be74312a954e240
2019-11-27 19:17:27 +00:00
Gabriel Masei
2164f5207c Add REST endpoint for admin metrics.
Change-Id: I701485631931334d27594c4907cb770f9888e5bf
Reviewed-on: https://gerrit.libreoffice.org/82492
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2019-11-25 13:06:01 +01:00
Miklos Vajna
0077b4ae6a wsd: fix -Werror,-Wmismatched-tags
If it's a struct, then forward-declare as struct, not as class.

Change-Id: Ia78d7c1bee222bd1f499fe93aaf2dda9b81f423a
2019-11-21 17:42:08 +01:00
Michael Meeks
cabd30a1b8 Initial wopi-like locking implementation.
Change-Id: I3e16cfc40dbd29a24016b09e62afc9ec488300c7
2019-11-21 14:24:58 +00:00
Ashod Nakashian
35fdc48e28 wsd: upload to storage when per_document.always_save_on_exit is set
Saving the document on exit is not enough, we also need
to send it to the storage. We now force doing that,
even when there is no modifiction to the document
(i.e. a new version wasn't really saved).

Reviewed-on: https://gerrit.libreoffice.org/81336
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
(cherry picked from commit f2913f20b03e916ce8a70f927ca3f5655a3768a8)

Change-Id: Ic4e1b1424f32d3141e98c936a51e47c9e4b9f753
Reviewed-on: https://gerrit.libreoffice.org/81576
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2019-11-06 03:41:44 +01:00
Michael Meeks
7890533419 TileCache: track and limit size to control memory usage.
Implement a basic WSD-side memory sizing approach and tell the
Admin console about it.

Change-Id: I1f0b5cf9fe29cb23ea574371e81e981b7af7a954
2019-10-28 20:29:01 +00:00
Ashod Nakashian
ae8d28478b wsd: reduce public surface area of DocumentBroker
Reviewed-on: https://gerrit.libreoffice.org/80323
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
(cherry picked from commit 46bdda0186f98eb27d15507ce3cc63b64a106942)

Change-Id: If74bd1967f3725e81a6e381e883eac86104f9f40
Reviewed-on: https://gerrit.libreoffice.org/81561
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2019-10-28 10:47:10 +01:00
mert
86489d3dcd Include normalizedViewId to TileCache
Change-Id: Ib23afa023d79189f7fd7aca8b5b0e198c3011fbc
2019-10-15 18:13:03 +03:00
Michael Meeks
5e7cac28fa belt & braces fix erroneous popup of limit dialog
The shared_ptr allows the DocumentBroker's and ConvertToBroker to linger
after they are removed from the list, making ConvertToBroker::getInstanceCount
potentially larger than the number of documents transiently. Fix this
with a dispose method called on list removal.
Also make the arithmetic signed, to avoid unfortunate wrapping.
Also when the limit is large, don't show a message whatever happens.

Change-Id: Id2571429de48ae75e851c3fdc49e24a02aaaf6e9
2019-10-04 11:01:45 +01:00
Ashod Nakashian
3dcc68e6f1 Pass Extended Data in Action_Save from the client to the WOPI host
Clients often need to communicate with their wopi hosts when
invoking Action_Save to provide more context when storing the
document in question. Action_Save now support passing arbitrary
string as ExtendedData entry that can be used by client to
pass any context or otherwise flags to the WOPI host, which
will receive it via the X-LOOL-WOPI-ExtendedData custom header.

See reference.html for more details.

Change-Id: I1814d1f3d984a553ffa60cec13d23b014ba59eb3
Reviewed-on: https://gerrit.libreoffice.org/74135
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
2019-09-03 01:53:12 -04:00
DarkByt31
22f1656e08 tdf#107038 Poco::Timestamp replacement with std::chrono
Added functions to get file timestamp and to convert
chrono timestamp in ISO8601 fraction format and some
test cases.

Change-Id: I58961a31f7262b367cff9f33cffdec7571a2f8f7
2019-09-02 15:50:37 -04:00
Miklos Vajna
bd4d72d41f common: wrap TerminationFlag in a getter function to avoid ODR violation
Otherwise both loolwsd and unit-copy-paste.so would have a
TerminationFlag:

==11732==ERROR: AddressSanitizer: odr-violation (0x00000208f4a0):
  [1] size=1 'TerminationFlag' ../common/SigUtil.cpp:41:19
  [2] size=1 'TerminationFlag' common/SigUtil.cpp:41:19
These globals were registered at these points:
  [1]:
    #0 0x5f9988 in __asan_register_globals.part.13 /home/vmiklos/git/libreoffice/lode/packages/llvm-472c6ef8b0f53061b049039f9775ab127beafbe4.src/compiler-rt/lib/asan/asan_globals.cc:365
    #1 0x7f5df9cf18cb in asan.module_ctor (/home/vmiklos/git/libreoffice/online-san/test/../test/.libs/unit-copy-paste.so+0x60a8cb)

  [2]:
    #0 0x5f9988 in __asan_register_globals.part.13 /home/vmiklos/git/libreoffice/lode/packages/llvm-472c6ef8b0f53061b049039f9775ab127beafbe4.src/compiler-rt/lib/asan/asan_globals.cc:365
    #1 0xe2b4fe in asan.module_ctor (/home/vmiklos/git/libreoffice/online-san/loolwsd+0xe2b4fe)

Change-Id: Ic620b143ecb77699f40676ff39d0fa7abceb34d5
2019-08-08 09:10:59 +02:00
Michael Meeks
9e791fb0d4 clipboard: persist selections for a while after a view closes.
re-factor ClientSession state to be a simpler state machine.
Have a nice disconnect / disconnected handshake on view close.

Change-Id: Ie933cc5c7dfab46c66f4d38a4d75c459aa1cff87
2019-08-05 22:21:54 -04:00
Michael Meeks
fbd021958b clipboard: de-combine whole clipboard fetch from just text/html.
Now we can copy/paste smileys internally again.

Change-Id: Ibc6c77ccb9c501230947a7172cf591b2e12531b3
2019-08-05 21:44:29 -04:00
Michael Meeks
13469e8b00 clipboard - set it with a post now.
Change-Id: I6b9234988185984335408da502f479ccda8a95a7
2019-08-05 21:18:44 -04:00
Michael Meeks
245e509413 clipboard: start of rotating clipboard key management.
Change-Id: I8caab267ec5391e2cd7cb20907fa080111cc70dd
2019-08-05 21:16:37 -04:00
Michael Meeks
4a9de331ed Unit testing - add more hooks and helpers.
Change-Id: Ieb12699e3b012606eaa0be3cc94d6f9b58adc441
2019-08-05 21:08:01 -04:00
Miklos Vajna
717816d44d wsd: add new always_save_on_exit config option
The default behavior is unchanged: once the last editor exits, we still
only perform a save when the document is modified.

It's possible to opt in for the new behavior, though: in that case the
save after the exit of the last editor will happen even for unmodified
documents.

Change-Id: I14c17035a932cf952217f3b71fdef57fede0ce24
2019-06-06 11:48:54 +02:00
Miklos Vajna
1a41e368ad wsd: avoid UB in DocumentBroker::cancelTileRequests()
With this, it's possible to open a document and type keys with
sanitizers enabled.

/home/vmiklos/lode/opt_private/gcc-7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/unique_ptr.h:323:9: runtime error: reference binding to null pointer of type 'TileCache'
    #0 0x911996 in std::unique_ptr<TileCache, std::default_delete<TileCache> >::operator*() const /home/vmiklos/lode/opt_private/gcc-7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/unique_ptr.h:323:2
    #1 0x8ecb2a in DocumentBroker::tileCache() /home/vmiklos/lode/dev/online/./wsd/DocumentBroker.hpp:265:37
    #2 0x8c6a63 in DocumentBroker::cancelTileRequests(std::shared_ptr<ClientSession> const&) /home/vmiklos/lode/dev/online/wsd/DocumentBroker.cpp:1586:37
    #3 0xb32b0e in ClientSession::_handleInput(char const*, int) /home/vmiklos/lode/dev/online/wsd/ClientSession.cpp:194:20
    #4 0xd45d3c in Session::handleMessage(bool, WSOpCode, std::vector<char, std::allocator<char> >&) /home/vmiklos/lode/dev/online/common/Session.cpp:219:13
    #5 0x768080 in WebSocketHandler::handleTCPStream(std::shared_ptr<StreamSocket> const&) /home/vmiklos/lode/dev/online/./net/WebSocketHandler.hpp:368:13
    #6 0x6f800d in WebSocketHandler::handleIncomingMessage(SocketDisposition&) /home/vmiklos/lode/dev/online/./net/WebSocketHandler.hpp:419:20
    #7 0xb2c644 in ClientSession::handleIncomingMessage(SocketDisposition&) /home/vmiklos/lode/dev/online/wsd/ClientSession.cpp:74:14
    #8 0xa6f641 in StreamSocket::handlePoll(SocketDisposition&, std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l> > >, int) /home/vmiklos/lode/dev/online/./net/Socket.hpp:1037:29
    #9 0x6ec63d in SocketPoll::poll(int) /home/vmiklos/lode/dev/online/./net/Socket.hpp:570:34
    #10 0x83af99 in DocumentBroker::pollThread() /home/vmiklos/lode/dev/online/wsd/DocumentBroker.cpp:387:16
    #11 0x8fc778 in DocumentBroker::DocumentBrokerPoll::pollingThread() /home/vmiklos/lode/dev/online/wsd/DocumentBroker.cpp:165:20
    #12 0xdff935 in SocketPoll::pollingThreadEntry() /home/vmiklos/lode/dev/online/net/Socket.cpp:184:9
    #13 0xe487bd in void std::__invoke_impl<void, void (SocketPoll::*)(), SocketPoll*>(std::__invoke_memfun_deref, void (SocketPoll::*&&)(), SocketPoll*&&) /home/vmiklos/lode/opt_private/gcc-7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/invoke.h:73:14
    #14 0xe482ca in std::__invoke_result<void (SocketPoll::*)(), SocketPoll*>::type std::__invoke<void (SocketPoll::*)(), SocketPoll*>(void (SocketPoll::*&&)(), SocketPoll*&&) /home/vmiklos/lode/opt_private/gcc-7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/invoke.h:95:14
    #15 0xe4817d in decltype(std::__invoke(_S_declval<0ul>(), _S_declval<1ul>())) std:🧵:_Invoker<std::tuple<void (SocketPoll::*)(), SocketPoll*> >::_M_invoke<0ul, 1ul>(std::_Index_tuple<0ul, 1ul>) /home/vmiklos/lode/opt_private/gcc-7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/thread:234:13
    #16 0xe47f87 in std:🧵:_Invoker<std::tuple<void (SocketPoll::*)(), SocketPoll*> >::operator()() /home/vmiklos/lode/opt_private/gcc-7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/thread:243:11
    #17 0xe4734a in std:🧵:_State_impl<std:🧵:_Invoker<std::tuple<void (SocketPoll::*)(), SocketPoll*> > >::_M_run() /home/vmiklos/lode/opt_private/gcc-7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/thread:186:13
    #18 0x7f5c2ce55e2e in execute_native_thread_routine /home/vmiklos/lode/packages/gccbuild/x86_64-pc-linux-gnu/libstdc++-v3/src/c++11/../../../../../gcc-7.3.0/libstdc++-v3/src/c++11/thread.cc:83
    #19 0x7f5c2c832558 in start_thread (/lib64/libpthread.so.0+0x7558)
    #20 0x7f5c2bf4682e in clone (/lib64/libc.so.6+0xf882e)

SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /home/vmiklos/lode/opt_private/gcc-7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/unique_ptr.h:323:9 in

Change-Id: Ief574a11c838c77f7f159b1133beeef0deada201
2019-05-24 09:04:16 +02:00
Michael Meeks
1845ed42af tdf#123482 - cleanup convert-to folder even more reliably.
Problems could occur if exceptiosn thrown when parsing the input stream.

Change-Id: Id82b3816450194164fc2093554c730b4a94acef1
Reviewed-on: https://gerrit.libreoffice.org/72695
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2019-05-22 01:57:48 +02:00
Tor Lillqvist
b5154eaf69 Make the document-specific threads in the iOS app go away more reliably
After a document is closed, the prisoner_poll, accept_poll,
websrv_poll, docbroker_nnn, and lokit_main threads that served that
document are supposed to go away as quickly and reliably as possible.
This change improves that significantly.

Change-Id: If658bea74f70a77d2d537f0ec6455a6b36f2667e
2019-05-21 02:40:28 +03:00
Tor Lillqvist
d9e5a47058 Introduce new flag to speed up shutdown of the Online plumbing in the iOS app
Spent hours on trying to cleverly use the existing TerminationFlag
(with minor modifications to the code that checks it, and some
additional code to set and reset it), but could not get it to work.
This is simpler, but sure, using a global variable is ugly of course.
At least the new MobileTerminationFlag is very specific in semantics
and only used in the mobile apps.

Change-Id: I0775fdfa7880750ca12c6fd7ec41d3d3ceb2f0ad
2019-05-16 11:44:41 +03:00
merttumer
0dbf9bcf27 Added RenameFile Support for WOPI
This patch concerns rename file operation when the integration
supports it
Signed-off-by: merttumer <mert.tumer@collabora.com>

Change-Id: Ibb4f615b91dda2491bfcd4d4738198d69eca4e6f
Reviewed-on: https://gerrit.libreoffice.org/71587
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
Signed-off-by: merttumer <mert.tumer@collabora.com>
2019-05-13 22:29:40 +03:00
Michael Meeks
c08b2f2ba4 Improve pid collection and printout for tests.
Change-Id: I820c1acbdbae41dd2c2c6bb7285b84bbb61e79d5
2019-05-03 13:52:15 +01:00
Michael Meeks
d8bb92cdcf Don't count convert-to connections vs. the document count.
Change-Id: I350905fb98c503ae8f22a377e4af5cbcb9f3c52d
2019-03-15 11:27:31 +01:00
Michael Meeks
2d473222e4 tdf#123482 - cleanup convert-to folder more reliably.
Change-Id: I029bb4136984e05485e462c92da80b92b00fdebc
2019-03-01 22:34:29 +01:00
Michael Meeks
51b72b04a9 Simpify DocumentBroker constructor.
Change-Id: I0bf29df9316b129d34862c7464bb6636d42a850d
2019-03-01 22:03:35 +01:00
Tor Lillqvist
8f71365f0f Remove unnecessary leftovers after Michael's removal of the on-disk tile cache
Change-Id: I435679b48f90d2580bb9c5c86a26c9a1d43c5b59
Reviewed-on: https://gerrit.libreoffice.org/67885
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2019-02-15 21:36:16 +01:00
Jan Holesovsky
f76b36193d android: #if(n)def MOBILEAPP -> #if (!)MOBILEAPP for better reliability.
Change-Id: I5f9c9420b6c83601db1c8fdba4ae5a10b17b2107
2019-02-12 12:20:11 +01:00
Tor Lillqvist
fb29e39899 There is no DocumentBroker::handleDialogPaintResponse() either
Change-Id: I84daa5da83b9d27c8bedadeb8a5d660573e00eb4
2019-02-08 15:47:35 +02:00
Tor Lillqvist
214fb20e7f There is no DocumentBroker::handleDialogRequest()
Change-Id: Ide3f00e898dd1d3dfde62f1eea1728beb6067b04
2019-02-08 15:38:40 +02:00
Samuel Mehrbrodt
2e9af9da16 Add custom http header when saving before document is cleaned up from memory
Change-Id: I3ac417d83a79a665ae6575097835542f43d40cef
Reviewed-on: https://gerrit.libreoffice.org/64499
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2018-12-05 11:50:59 +01:00
Tor Lillqvist
235c9b8a60 Use getAbbreviatedMessage() for its intended purpose
Don't log a potentially very long message in its entirety.

Change-Id: I01fbf76465d99bbab117d1dcacc6c7239a1da518
2018-11-29 01:07:03 +02:00
Michael Meeks
fa74404019 Add a time limit for badly behaved / huge document load / conversions.
Also improve debug printing of load times in dumpstate.

Change-Id: Ib3fd70dffb57588cd90bd928c4be9890cee8bc65
2018-11-08 01:27:40 +00:00
Tor Lillqvist
f29be2442d In ChildProcess::isAlive(), check _pid also in the MOBILEAPP case
... instead of returing always true.

The close() member function sets _pid to -1. We should just trust
that.

This helps a bit in making the app reach the the fully idle state
faster after closing a document. Tbere were two clear pointless delays
visible in log output: A long one followed by a shorter one. This gets
rif of the latter delay. Still need to find the root cause for the
former one.

Change-Id: I6d890e9eb59d076fde5aa93c55c44acc452b8124
2018-10-30 19:34:04 +02:00
Ashod Nakashian
0264dba09e wsd: anonymize load command sent to Kit
Change-Id: Ic509ceb5c38bc50152f1d00bd5718089fe664ac1
2018-10-16 20:12:23 -04:00
Tor Lillqvist
95eb849217 Still more iOS app and related Online C++ code hacking
Re-think the plumbing between the different parts of the C++ Online
code. Do try to have it work more like in real Online on all but the
lowest socket level. Except that we don't have multiple processes, but
threads inside the same process. And instead of using actual system
sockets for WebSocket traffic between the threads, we use our own
FakeSocket things, with no WebSocket framing of messages.

Reduce the amount of #ifdef MOBILEAPP a bit also by compiling in the
UnitFoo things. Hardcode that so that no unit testing is ever
attempted, though. We don't try to dlopen any library.

Corresponding changes in the app Objective-C code. Plus fixes and
functionality improvements.

Now it gets so far that the JavaScript code thinks it has the document
tiles presented, and doesn't crash. But it hangs occasionally. And all
tiles show up blank.

Anyway, progress.

Change-Id: I769497c9a46ddb74984bc7af36d132b7b43895d4
2018-09-19 11:31:18 +03:00
Tor Lillqvist
b59d160a08 Intermediate commit of work in progress on an iOS app
The app is unimaginatively called "Mobile" for now.

Runs but crashes pretty quickly after loading the document by the LO
core. Will need some heavy changes to get a ClientSession object
created in there, too, to handle the (emulated) WebSocket messages
from the JavaScript. It would then handle some of these messages
itself, and forwards some to the ChildSession, which in this case is
in the same process. Now the messsages from the JavaScript go to a
ChildSession, which is wrong. As the assertion says, "Tile traffic
should go through the DocumentBroker-LoKit WS"
2018-09-12 18:32:05 +03:00
Tamás Zolnai
15afe2c0fb Wait tileprocessed message from client to send new bunch of tiles
We always  one bunch of tiles (e.g. all tiles invalidated) and we
are waiting until client send tileprocessed message back for all
tiles before sending the new tiles.
By canceltiles message we drop every previously requested tiles and
make wsd ready to send new tiles, which will be requested by the client
in theory.

Change-Id: I9901420ada549e962ffaf5e6bd58e52b86bd129d
2018-07-19 14:10:08 +02:00
Ashod Nakashian
b3bdd5786d wsd: support optional forcing tracking changes at load
Since changing the tracking state is done by toggling,
we need to wait to get the current state at load time
before we can tell whether we need to toggle it or not.

Change-Id: Ib5a2639b2acf3874c191971eedf9a3bebcefebad
Reviewed-on: https://gerrit.libreoffice.org/53415
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2018-06-14 17:00:39 +02:00
Jan Holesovsky
432a1c7d78 Split close(bool) into close() and terminate().
The bool flag was causing 2 complete separate code paths anyway.

Also remove stop(), calling stop() followed by close() made no
difference.

Change-Id: Ica4c887b0324390d4e006a26eb4119bd5ab08723
2018-05-18 15:16:40 +02:00
Jan Holesovsky
088acf5e98 Before we kill the child, check it exists, ie. kill(pid, 0) == 0.
Also warn when anything was left out.

Without this, we leave abandoned children around.

Change-Id: I293a530ffceeb7f6bdc0cc775335c782945de6e7
2018-05-18 15:16:40 +02:00
Pranav Kant
d189ed90cc Document stop() vs closeDocument()
Change-Id: I52483c0300d1d4c5b1def80b71ccd0661590bfab
2018-02-08 12:30:23 +05:30
Pranav Kant
5476774af1 wsd: Use a close request flag to break out of doc broker poll thread
... instead of directly stop()ing it. The close request approach also
makes sure that outgoing document is saved to storage.

Change-Id: I44f61db00dbd326dec80f59f4a2cbb617048aa94
Reviewed-on: https://gerrit.libreoffice.org/49122
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2018-02-07 14:30:33 +01:00
Pranav Kant
5bd124499c wsd: Bin superfluous public method
Passing the reason to stop() method also does the same thing.

Change-Id: I16b648495382c14f31839acca815835df76d8dca
2018-02-02 03:16:30 +05:30
Ashod Nakashian
f7fc3f494c wsd: save before stopping
We don't force saving unconditionally now. Only
when the doc is reasonably expected to be modified
do we force saving (to circumvent the minimum duration
between auto-saves).

We invoke auto-saving before stopping the DocBroker
polling loop, whether due to idleness or server recycling.

Change-Id: I257d55f190d3df6a3ba82f2666c7602da0581d0c
Reviewed-on: https://gerrit.libreoffice.org/47887
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2018-01-15 15:04:14 +01:00
Ashod Nakashian
b5baf3672f wsd: stop DocBroker using only stop() member
Now always given a proper reason too.

Also, stop polling thread and cleanup when
failing to acquire/spawn a child process.

Change-Id: I7ddee01dd47b8ee72f2d9134c0f1b264634d8611
Reviewed-on: https://gerrit.libreoffice.org/47886
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2018-01-15 15:03:21 +01:00
Ashod Nakashian
8ad29ee050 wsd: separate lastSaveTime from lastSaveResponseTime
Previously we assumed we are saving based on
lastSaveTime, which is incorrect because it
is set only upon successful saving and storing,
which might fail.

Now lastSaveResponseTime is used to track whether
there are saving requests in flight. And lastSaveTime
is only used when we do store the document in storage.

Change-Id: I73e5c04432981d0cca11b8cf854414738bd894de
Reviewed-on: https://gerrit.libreoffice.org/47884
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2018-01-15 15:02:40 +01:00
Ashod Nakashian
a3a8551f2d wsd: remove lastEditableSession flag
Maintaining a flag is problematic, at least the way
it was reset on adding new sessions. Luckily there
should be no reason for having it, since we should
check it only when removing sessions. Also, we
need to check for every case of removal, and not, as
was, just on disconnection, which is incomplete.

Change-Id: I878766701228c41fc93eeaff21852fa887de9eff
Reviewed-on: https://gerrit.libreoffice.org/47883
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2018-01-15 15:02:27 +01:00