Commit graph

419 commits

Author SHA1 Message Date
Henry Castro
8b87f63325 kit: fix status indicator finish
Unfortunately the sequence message sent
from LO core is important, and the status
indicator finish should arrive to client side
before any dialog interactivity (i.e. Macros Warning Dialog).

However the LO core sends like 3 times status
finish for now we cannot duplicate them.

Change-Id: Ieee2ee93555b50b0e67507aae36096e10728a038
Signed-off-by: Henry Castro <hcastro@collabora.com>
2021-10-04 10:08:58 +02:00
Ashod Nakashian
ff1ff12663 wsd: each view handles its own url params
Change-Id: I0c6b9b86c970b1f45e7fa34d030f08c6f256d082
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
(cherry picked from commit d4aa0a0f73eef5a90a14a2297f3050c1dba95a2d)
2021-09-26 17:02:01 -04:00
Tor Lillqvist
6d2a6e110c Remove leftover tiles in the iOS app already when the document is closed
Normally (ideally), tiles (.bmp files) are removed as soon as the JS
has displayed them. But occasionally something goes wrong and they are
left behind. (For instance, it seems to happen if the user closes the
document immediately when it shows up.)

Do not leave them on disk until the app starts the next time.

Change-Id: I0c764280a69a16ad3b7b67c329832fd5331c2e1e
Signed-off-by: Tor Lillqvist <tml@collabora.com>
2021-09-01 13:32:23 +03:00
Gopi Krishna Menon
b3d5a2563c Add profilezone around kitPoll function and SocketPoll constructor
Add profile zone around kitPoll function and SocketPoll constructor to
improve trace event generation

Signed-off-by: Gopi Krishna Menon <krishnagopi487.github@outlook.com>
Change-Id: Ia46e9add59a57935997649fe39861a8d851e1ff0
2021-07-21 15:00:31 +03:00
Gopi Krishna Menon
de403fc12e Improve logging Information
Improve logging information in setdocumentPassword for better clarity :)

Signed-off-by: Gopi Krishna Menon <gopi.menon@collabora.com>
Change-Id: I292991cbee2cf0cf1430ba4c5626b6e08ccbc0f5
2021-07-02 17:17:02 +03:00
Michael Meeks
e289597315 Add a processtoidle event implementation.
This can be used to accelerate unit tests by allowing us to ensure
that all pending work is done between a 'processtoidle' message being
sent and an 'idle' being returned. This can be much faster than waiting
a defined length of time.

Change-Id: I6d96de205d1fd34a22e0ddbd2709bf806a97b33c
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2021-06-29 17:12:01 +01:00
Tor Lillqvist
7d7b511b83 Guard against the config system being uninitialized
Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: Ifcd2852433bb329c938755300b84a74dd22a8a07
2021-06-21 12:43:17 +03:00
Tor Lillqvist
4c68a97ce5 Re-factor Trace Event stuff for improved functionality and thread safety
Write to the Trace Event JSON file in just one place, protected by a
mutex.

Handle metadata events separately. We want them to propagate to the
output if Event Trace generation is just enabled, regardless whether
it has been turned on or not.

We can send the metadata for the Kit process only after we have opened
the docuemnt as sending a Trace Event to WSD uses the (singleton)
Document object in Kit.

Introduce some new functions for the above and adapt callers
appropriately.

Generate a Complete event for the handling of one image tile, from
setting the src attribute of the Image object to finishing the onload
function.

Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: I5978e0fb2495e0d2dc479bf861eb4ac7da03fa50
2021-06-21 12:43:17 +03:00
Tor Lillqvist
12c48004b9 Add a newline after the Trace Event object string here
Just for clarity, so that each object ends up on a line of its own in
the Trace Event output JSON file.

The stringified object already should contain the comma separator at
the end. Probably should change that, make it so that the comma
separators are added when emitting to the file (or sending to WSD.

Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: Ibef117afbe9f099c26b42ce32d280055df86d984
2021-06-21 12:43:17 +03:00
Tor Lillqvist
8513a25d06 Emit a Trace Event metadata event for the name of a Kit process
Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: I5fd41d27b63fc9b16a4b06d014dbeedb673121c3
2021-06-21 12:43:17 +03:00
Michael Meeks
7227c7c48a Remove dupliate forward definition.
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2021-06-15 15:44:21 +01:00
Michael Meeks
f8a5edb995 Transfer LOK callback processing into our main thread if necessary.
While we are processing data in the poll handler, we can have
another helpful thread from the core sending things to us:

loolforkit(Socket::assertCorrectThread(char const*, int))
loolforkit(WebSocketHandler::sendFrame(std::shared_ptr<StreamSocket> const&, char const*, unsigned long, unsigned char, bool) const)
loolforkit(WebSocketHandler::sendMessage(char const*, unsigned long, WSOpCode, bool) const)
loolforkit(Document::postMessage(char const*, int, WSOpCode) const)
loolforkit(Document::sendFrame(char const*, int, WSOpCode))
loolforkit(ChildSession::sendTextFrame(char const*, int))
loolforkit(ChildSession::loKitCallback(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&))
loolforkit(Document::GlobalCallback(int, char const*, void*))
/core/instdir/program/libsofficeapp.so()
/core/instdir/program/../program/libfwklo.so()
/core/instdir/program/libscfiltlo.so()
/core/instdir/program/libexpwraplo.so()
/core/instdir/program/libooxlo.so(oox::core::FastParser::parseStream(com::sun::xml::sax::InputSource const&, bool))
/core/instdir/program/libooxlo.so(oox::core::FastParser::parseStream(com::sun::uno::Reference<com::sun::io::XInputStream> const&, rtl::OUString const&))
/core/instdir/program/libooxlo.so(oox::core::XmlFilterBase::importFragment(rtl::Reference<oox::core::FragmentHandler> const&, oox::core::FastParser&))
/core/instdir/program/libscfiltlo.so()
/core/instdir/program/libcomphelper.so(comphelper::ThreadTask::exec())
/core/instdir/program/libcomphelper.so()
/core/instdir/program/libuno_salhelpergcc3.so.3(salhelper::Thread::run())
/core/instdir/program/libuno_salhelpergcc3.so.3()
/core/instdir/program/libuno_sal.so.3()
/lib/x86_64-linux-gnu/libpthread.so.0()
/lib/x86_64-linux-gnu/libc.so.6(clone)

This is most likely from eg. threaded parsing of various file formats,
or progress messages while loading / saving, sent while the SolarMutex
is locked.

We assume that:
  + there will only ever be one thread running inside kitPoll
    this is enforced by vcl/headless.
  + and so, we can safely mutate SocketPoll and Socket buffer
    state from this thread.
  + there are only two entry points for callbacks from threads
    in core - which are both instrumented, and if necessary
    their work is shifted to this thread.

Memory corruptions matching the above trace, suggesting that
multiple writes have collided between kitPoll and an event
callback have been seen in the wild.

Change-Id: I5b084cbfec1ea326b6e17c9e5590a8c8e35b3854
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2021-06-14 09:31:26 +01:00
Michael Meeks
655493a7bc Transfer LOK callback processing into our main thread if necessary.
While we are processing data in the poll handler, we can have
another helpful thread from the core sending things to us:

loolforkit(Socket::assertCorrectThread(char const*, int))
loolforkit(WebSocketHandler::sendFrame(std::shared_ptr<StreamSocket> const&, char const*, unsigned long, unsigned char, bool) const)
loolforkit(WebSocketHandler::sendMessage(char const*, unsigned long, WSOpCode, bool) const)
loolforkit(Document::postMessage(char const*, int, WSOpCode) const)
loolforkit(Document::sendFrame(char const*, int, WSOpCode))
loolforkit(ChildSession::sendTextFrame(char const*, int))
loolforkit(ChildSession::loKitCallback(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&))
loolforkit(Document::GlobalCallback(int, char const*, void*))
/core/instdir/program/libsofficeapp.so()
/core/instdir/program/../program/libfwklo.so()
/core/instdir/program/libscfiltlo.so()
/core/instdir/program/libexpwraplo.so()
/core/instdir/program/libooxlo.so(oox::core::FastParser::parseStream(com::sun::xml::sax::InputSource const&, bool))
/core/instdir/program/libooxlo.so(oox::core::FastParser::parseStream(com::sun::uno::Reference<com::sun::io::XInputStream> const&, rtl::OUString const&))
/core/instdir/program/libooxlo.so(oox::core::XmlFilterBase::importFragment(rtl::Reference<oox::core::FragmentHandler> const&, oox::core::FastParser&))
/core/instdir/program/libscfiltlo.so()
/core/instdir/program/libcomphelper.so(comphelper::ThreadTask::exec())
/core/instdir/program/libcomphelper.so()
/core/instdir/program/libuno_salhelpergcc3.so.3(salhelper::Thread::run())
/core/instdir/program/libuno_salhelpergcc3.so.3()
/core/instdir/program/libuno_sal.so.3()
/lib/x86_64-linux-gnu/libpthread.so.0()
/lib/x86_64-linux-gnu/libc.so.6(clone)

This is most likely from eg. threaded parsing of various file formats,
or progress messages while loading / saving, sent while the SolarMutex
is locked.

We assume that:
  + there will only ever be one thread running inside kitPoll
    this is enforced by vcl/headless.
  + and so, we can safely mutate SocketPoll and Socket buffer
    state from this thread.
  + there are only two entry points for callbacks from threads
    in core - which are both instrumented, and if necessary
    their work is shifted to this thread.

Memory corruptions matching the above trace, suggesting that
multiple writes have collided between kitPoll and an event
callback have been seen in the wild.

Change-Id: I5b084cbfec1ea326b6e17c9e5590a8c8e35b3854
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2021-06-11 14:19:55 +01:00
Tor Lillqvist
1c316bb7b8 Fix crash in iOS app
No separate Kit process in the mobile apps, and the iOS app even can
have several documents open simultaneously, so the singletonDocument
variable does not make sense.

If we at some stage want to generate Trace Event log files also in the
iOS or Android app (perhaps not likely), will have to handle it in a
different fashion. All the code runs in one process anyway in the
mobile apps, so it wouldn't make sense to "send" collected Trace
Events to the code standing in for the WSD process.

Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: I5777b48e98121c3ed55e590d5009e2658af2ef22
2021-06-11 14:07:57 +03:00
Tor Lillqvist
8cef48a0fa Introduce a generic TraceEvent class and instant events here, too
Modelled on how it is done in core. ProfileZone is derived from
NamedEvent which is derived from TraceEvent. Here we don't keep any
separate ProfileZone.hpp, though.

This was needed to introduce generation of "instant" events here, too.

Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: I6583134e96001641c50339deb4197fca6ab7d5d5
2021-06-02 09:04:21 +03:00
Tor Lillqvist
7785eb0481 Keep the return value from config::getBool() in static const bools
Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: I823cbd4ace71f9fd5a45e6c042599cdea03458c8
2021-05-31 10:56:19 +03:00
Tor Lillqvist
2ac4350e22 Don't send individual ProfileZone recordings to the WSD process, but buffer them
Change-Id: Ie3ec57ff38035d786ae081266ed81793bcf60514
Signed-off-by: Tor Lillqvist <tml@collabora.com>
2021-05-31 10:56:19 +03:00
Tor Lillqvist
3553430a62 Try to fix iOS and Android build
Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: I0839c589517f64d966fec9f247dda4163bdbe5fd
2021-05-31 10:56:19 +03:00
Tor Lillqvist
929e466c91 Re-work the ProfileZone implementation here
Don't bother collecting them into a vector, like in core. Instead,
just call a static member function ProfileZone::addOneRecording() for
each Event Trace object (string) to be emitted. That function then
needs to be implemented separately in each executable. In WSD it logs
the object to the Event Trace file. In Kit it sends it to WSD for
logging. In Unit tests we use a dummy implementation.

(If Event Trace logging is not enabled at all in loolwsd.xml (the
default), nothing is done, of course.)

When receiving the "traceeventrecording start" or "traceeventrecording
stop" message from the client, turn ProfileZone recoring on or off in
the WSD and Kit process. (Probably in WSD the flag should be
per-client.)

Change-Id: Ie1127d65dd44ed77e7eeab4b0f0a90cce95dc4a2
Signed-off-by: Tor Lillqvist <tml@collabora.com>
2021-05-31 10:56:19 +03:00
Tor Lillqvist
9d45ab005c Add TODO
Change-Id: Id75eaacbdb826892bd7dbc4329852a3716e1719a
Signed-off-by: Tor Lillqvist <tml@collabora.com>
2021-05-19 13:33:26 +03:00
Tor Lillqvist
9c6b74ad08 Use a loolwsd.xml setting instead of --enable-trace-event-logging
That is our convention, and this also avoids a global variable in the
kit process.

Change-Id: I37d2d53aa7eb24f9848fa8ef98bc57d75db90d13
Signed-off-by: Tor Lillqvist <tml@collabora.com>
2021-05-19 13:33:26 +03:00
Gökhan Karabulut
dbbf03d63b Remove unused field
Field `_lastMemStatsTime` is not used, so remove it.

Signed-off-by: Gökhan Karabulut <gokhanettin@gmail.com>
Change-Id: I4739e5f64d44b04b5c2c9c5c4081b05f2bb4e0ee
2021-05-13 09:29:35 +01:00
Gökhan Karabulut
7f736a9bc4 Improve state dump
Add `dumpState` methods to `TileQueue`, `PngCache`, `ThreadPool` classes
and call them from Document::dumpState method within kit.Kit.cpp.
Because `dumpState` method of `_websocketHandler` is protected,
currently we can't dump its internals.

Also dump the other members of the `Document` class. Note that as
`_lastMemStatsTime` is never used, we don't dump it. It seems we could
simply delete it.

Signed-off-by: Gökhan Karabulut <gokhanettin@gmail.com>
Change-Id: Ia89b7fff41eaf475c7a09a644c0eb523b72cf97d
2021-05-13 09:29:35 +01:00
Tor Lillqvist
9da0145280 Add an --enable-trace-event-logging option to loolwsd
It enables turning Trace Event recording on (and off again). The
option is passed down to the client through loleaflet.html, and to the
KIT processes. If the option is not used, the new JS functions that
send trace events to the server turn into no-ops to avoid wasting
bandwidth.

It is always on in a "make run".

Change-Id: Iafe1919ccba7c376137d3e0568b857e20780bbc8
Signed-off-by: Tor Lillqvist <tml@collabora.com>
2021-05-10 12:39:07 +03:00
Michael Meeks
900bf62682 Avoid parsers believing that the body is a forward message.
We need a space after the prefix here to get past the
getForwardToken detection in the core; \n doesn't cut it.

Change-Id: I3f125d47586964ff844f0a89b04b8de866d01f8b
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2021-05-06 20:31:55 +03:00
Tor Lillqvist
be476d23b3 Produce a Chrome Event Trace file
It is (for now) produced (by the ProfileZone things in core) whenever
logging level is "trace". The Event Trace file pathname can be given
in the loolesd.xml file or on the loolwsd command line.

Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: I6d5829121e71460a4600ee94d2ebf51043c8893f
2021-05-03 16:09:35 +03:00
Miklos Vajna
656eb310bb Fix Debian 8 / gcc-4.9 warnings
net/HttpRequest.cpp:126:19: error: declaration of 'end' shadows a member of 'this' [-Werror=shadow]

kit/Kit.cpp:163:29: error: missing initializer for member 'statfs::f_bsize' [-Werror=missing-field-initializers]

kit/Kit.cpp:171:14: error: 'OVERLAYFS_SUPER_MAGIC' was not declared in this scope

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: Ibbd35ab5af3adad403ed22a0aeb70917b9e21970
2021-04-30 10:38:09 +02:00
Ashod Nakashian
029fe9275e wsd: initialize config and use it in Kit
Change-Id: I0c6047ab2083b3fbfbade89d1c1ef04eb6e3b6c1
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-02 12:43:39 -04:00
Ashod Nakashian
08eab4bc15 wsd: more config features
Change-Id: I2fb33a2d89ab886bc454ae961dbff7b6c2c1b0ef
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-02 12:43:39 -04:00
Ashod Nakashian
db36d079ce wsd: pass the config from loolwsd to forkit
Change-Id: If89a5021bc7d86d630511abb65839f5448f4bd3d
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-02 12:43:39 -04:00
Gleb Popov
c3a3a0d7a8 Mark the argument as unused to silence compiler warning.
Signed-off-by: Gleb Popov <6yearold@gmail.com>
Change-Id: I99731e183afb7a8164f3e4d5e737e7e78f02a0a2
2021-03-27 17:59:11 -04:00
Michael Meeks
c2b11b5e5b Dump versions when we have a signal.
Change-Id: I6b1f5ac1cebdd05dd9ff9541a5418059f55841ed
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2021-03-25 19:46:36 +00:00
Ashod Nakashian
1f978d9b50 wsd: cleanup Poco headers
Change-Id: I1eec2301576fc2f1cde40389b1f858f80b1204c0
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-03-22 10:09:22 -04:00
Michael Meeks
479447637b Optimize for overlayfs by forcing an initial copy to linkable/
built-in hard-link support performs extremely badly otherwise.

Change-Id: I26d5080590538cb6342d64e2e0a4023bbc84c427
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2021-03-15 15:47:34 +02:00
Henry Castro
1df271b363 config: add "macro_security_level" item
"Level of Macro security".

Change-Id: I491648f2a89289c7f4455dfad76d73ac8449b965
Signed-off-by: Henry Castro <hcastro@collabora.com>
2021-03-12 08:23:56 -04:00
Henry Castro
50c0fc4492 config: add "enable_macros_execution" item
"Specifies whether the macro execution is enabled in
general. This will disable Basic, Beanshell, Javascript
and Python scripts. If it is set to false, the
macro_security_level is ignored. If it is set to true,
the mentioned entry specified the level of macro security".

Change-Id: I4bc5b690268a93994d17e2b02b7b60b6398646b7
Signed-off-by: Henry Castro <hcastro@collabora.com>
2021-03-12 08:23:56 -04:00
Ashod Nakashian
74d019e716 wsd: cosmetic
Change-Id: I98d16305d461f5b081756d4a5c518d3616483538
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-03-08 22:49:53 -05:00
Ashod Nakashian
1837fb7fa1 wsd: avoid using shared_ptr copies
Change-Id: I5ee6e1cf56d984e0cb5407c556d53fc736cdb794
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-03-08 22:49:53 -05:00
Ashod Nakashian
6f59004e5c wsd: remove unused time_point argument from drainQueue
Change-Id: Ib6c48ab63ab09205e90968c6d455848e2d24f3e4
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-03-08 22:49:53 -05:00
Ashod Nakashian
f8c1857447 wsd: reduce jail size
Change-Id: I9fd1c76aff9c97b800c6b7b6154beb9c596170fb
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-03-06 08:52:50 +00:00
Henry Castro
266623aa2d kit: revisit log messages kit.cpp
LOG_FTL = abnormal, crash, denied service
LOG_ERR = load, save, session, connection, wrong parameters
other cases LOG_WRN, LOG_INF

Change-Id: Ieefc881876106b1afc4f34505903f1321b33411b
Signed-off-by: Henry Castro <hcastro@collabora.com>
2021-02-26 11:22:58 -04:00
Ashod Nakashian
418f694720 Revert "kit: enable send LOK_CALLBACK_STATUS_INDICATOR_FINISH"
The commit in question breaks two unit-tests: wopi-template
and copy-paste. Temporarily reverting until the regressions
it introduces are resolved.

This reverts commit be68f06f70.

Change-Id: I1fafd73fdea57077eea05a146b7df0b013e6e8ba
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-02-25 14:14:59 -05:00
Henry Castro
c24c7d9335 wsd: add an option "batch mode" to load the document
disable any dialog interactivity

Change-Id: I6d6fde721c7b3c18c519f87139525fcac1f6fb31
Signed-off-by: Henry Castro <hcastro@collabora.com>
2021-02-22 14:59:59 -04:00
Henry Castro
be68f06f70 kit: enable send LOK_CALLBACK_STATUS_INDICATOR_FINISH
Otherwise the LOK_CALLBACK_STATUS_INDICATOR_FINISH
message is lost, and client side does not receive
it when Macro Security dialog popup.

Change-Id: Ife52c77078160b8cc1075eff9137de2d26b87b55
Signed-off-by: Henry Castro <hcastro@collabora.com>
2021-02-22 14:58:58 -04:00
Ashod Nakashian
81da7c7bff wsd: download templates by wsd
Templates were downloaded by Core
upon loading. This works fine, as
long as there is no special network
setup in loolwsd. However, when
loolwsd has a complex network setup,
such as when using reverse proxies,
Core wouldn't know about the details
and would likely fail to download
the template.

Luckily, there is no reason to rely
on Core for downloading templates.
Instead, we download it in loolwsd,
just like any other document, and
load it in Core as normal. The
remaining post-load saving of
templates remain unchanged.

Change-Id: Ib22ada4ae469863d5e5c8baeee27f667f7cd40ff
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-02-15 09:41:17 -05:00
Ashod Nakashian
6d11e400a7 wsd: userName is optional
This resolves a dependency on userName
(a.k.a. UserFriendlyName) that was a source
of issues when missing.

It turns out that when it's missing but
spellOnline is set, an edge-case caused
an exception that failed loading.

The spellOnline value, in its turn, was
incorrectly set to "null" when in fact
it was missing. This resulted in online
spell-checking being active by default.
Perhaps this was intentional, but here
we don't change this behavior at all.
Instead, we avoid sending "null" when
it's missing, and by default we always
enable online spell-checking, unless
it is explicitly set to "false".

This way, the exception is not thrown
and spellOnline doesn't have invalid
values, while preserving the current
behavior.

Change-Id: I4a09ac44ff5d6147c715afa0fb34af9650da4afd
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-02-13 13:25:48 -05:00
Szymon Kłos
357cb8b22e Allow to show help in global callback
This is needed to show help in macro security warning
dialog which is showed before the document is loaded.

Change-Id: Ic50bac0c860c5673ce3ec854e54d658157d2a9dd
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
2021-02-11 12:32:41 +01:00
Tor Lillqvist
c535040952 Use correct naming convention
Change-Id: I6aa3b7b25ae9eff462580eb17ceaa5bc40359c53
Signed-off-by: Tor Lillqvist <tml@collabora.com>
2021-01-25 18:06:56 +02:00
Tor Lillqvist
f1e074f6bc Add caching of tunnelled dialog images
The same cache size is used in server and client. The caches use the
invalidation algorithm. Pass the hash of the pixmap in the
windowpaint: message. The client stores dialog images in its cache.
The server stores hashes of the images. When the server knows that the
client already has an image cached, it sends just its hash and the
client will use the cached image.

Pass the size of the cache to the client so that we don't have to keep
the the cache size synchronised in two places in the code.

Change-Id: Ie6cbfca79a9ede48fcc115e3acc669b925bb624e
Signed-off-by: Tor Lillqvist <tml@collabora.com>
2021-01-25 17:48:33 +02:00
Michael Meeks
673c3cfb98 Remove un-used _isLoading and ScopeGuard.
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: I0f7536023cbbef52087c3110565d046dd1ab8835
2021-01-13 16:55:35 +00:00