Commit graph

888 commits

Author SHA1 Message Date
Tamás Zolnai
f1a385be98 Get back "Cancel tiles also in wsd's senderqueue"
This reverts commit ec8b7bc012.

Change-Id: I0a4f3f529c86522261085d4feec45e4b56a7e0e6
2018-08-17 23:47:10 +02:00
Tor Lillqvist
4dd62d4dd2 Revert "Add a cache of "thumbnails" (PNG images) generated using the convert-to API"
No need to keep such a cache here. The consumer of previews
(thumbnails) in question does it itself (Nextcloud).

This reverts commit 405b66c8db

Change-Id: Iad16212ccbc875fe4f6d041e2fceef7eaea1d1bb
2018-08-15 15:01:03 +03:00
Tor Lillqvist
b811f70492 Revert "When asked to convert to PNG, look for an embedded ODF thumbnail first"
The embedded ODF thumbnail in documents produced by OOo or LO is too
small (max 256 pixels) to be useful in general, so let's not bother.

This reverts commit 3a9e536dfa.

Change-Id: I503b61f85264b9be658064632ffd1f94518b2a3c
2018-08-15 11:36:20 +03:00
Miklos Vajna
9ed7c1065c common, kit, test, wsd: these parameters are copied for each invocation ...
... but passing by const ref is enough
2018-08-13 09:26:15 +02:00
Tamás Zolnai
6d3a0d0327 Update row by row, instead of column by column
Change-Id: I504cab9509d25eebf3f68c63dd7e18a54f80d865
2018-08-10 17:49:48 +02:00
Tamás Zolnai
3bc8821bb0 Enough to have smaller tiles-on-fly limit
Change-Id: I7e9e1b2c117cb8938b6f0fb2eac8ab3e2c8fef30
2018-08-10 17:49:48 +02:00
Tamás Zolnai
1a885b9c40 Store wireId only for tiles inside the visible area
Change-Id: If60015c86bbdd1158c203a7a9c47b3dc877ac6c5
2018-08-07 16:22:48 +02:00
Tamás Zolnai
e35ce41eaa Need to reset wireId map anytime when part number changes
Change-Id: I8309a0a0788587f6daebe9698723df6bc0410039
2018-08-07 16:22:48 +02:00
Tamás Zolnai
cec718d0f1 Fix TileCacheTests::testCancelTilesMultiView failure
Change-Id: I9d05a1f041611a30f598c18c13525e807851604d
2018-08-03 12:26:10 +02:00
Tamás Zolnai
ec8b7bc012 Revert "Cancel tiles also in wsd's senderqueue"
This reverts commit 0bb96131c4.

Change-Id: Iffea072aabc88e5150e6ec069917b7965850683a
2018-08-03 12:21:29 +02:00
Miklos Vajna
468f8fedb5 wsd: 'path' is copy-constructed from a const reference but is only used as const reference
Make it a const reference.
2018-08-03 09:10:09 +02:00
Jan Holesovsky
521afe2e98 Add possibility to strace loolforkit if necessary for debugging.
Needs a rebuild with STRACE_LOOLFORKIT defined, and setting the
appropriate capabilities for the strace binary.

Change-Id: I43d45fbafa3868f6ae42f740a773ad9ed7add668
2018-08-03 05:21:25 +02:00
Jan Holesovsky
6ab7acc6d6 wsd: Kill --nocaps, and use --o:security.capabilities="false" instead.
The --nocaps apparently stopped working when the security.capabilities was
introduced.

Change-Id: Ieee173e97b62eb4e254667bd105826486e6bdbcb
2018-08-03 05:20:56 +02:00
Tamás Zolnai
165e5b4e1c Use a bigger number as a tiles-on-fly limit
So scrolling can be more smooth.

Change-Id: I7b029c0ccc2de6883db54493a9188ae54a346a1d
2018-07-31 17:19:12 +02:00
Tamás Zolnai
8d95ca7165 Make client tilesBeingRendered tracking more robust
Store the tile cache names and drop outdated tiles
times to times, so we can avoid tile rendering / sending to
stuck.

Change-Id: Ibff001307c7c660cbc57ab20c29c430e0090444d
2018-07-31 15:44:15 +02:00
Tamás Zolnai
30cdbc330b Unused method
Change-Id: I53c2a33313fbcd3cd0484c0e8a27985c673ad04e
2018-07-31 15:02:25 +02:00
Tamás Zolnai
0bb96131c4 Cancel tiles also in wsd's senderqueue
Change-Id: I683b3cacee2f87d0dc0f28ad9ac3e122bcd043f1
2018-07-31 13:18:44 +02:00
Miklos Vajna
6f3fd44c03 wsd: make these a const reference instead of copying for each invocation 2018-07-31 09:19:03 +02:00
Tamás Zolnai
c2a5f6acb0 Store number of tiles sent to kit for rendering
and use that info also to avoid sending to much tiles on the network.

Change-Id: Iab2d7af64693047a3c1cfe9f73de80a7100bbc13
2018-07-24 20:52:53 +02:00
Tamás Zolnai
b014804ce2 Trace sent tiles when they are actually sent
SenderQueue might drop some tiles, so we were waiting for
tileprocessed message for a tile which was not sent at all.

Change-Id: I7c502966f656e46df7c22002dee19aeabbf97774
2018-07-24 20:52:45 +02:00
George Wood
73b8da4ab0 Cleanup error reporting. 2018-07-24 12:27:35 +01:00
George Wood
e8235e50c8 A more attractive 404 page. 2018-07-24 12:27:35 +01:00
Tamás Zolnai
fe5507f134 Add some additional comment related to latency changes
Change-Id: I3ece60ce8a66730a8f8a93757412bcaa2b02a77d
2018-07-19 14:18:11 +02:00
Tamás Zolnai
8d92b0809d Store wiredIDs on the server side
So we can use this information in tile requests.

Change-Id: I87ba420ec0fd699353d48a228268e546ace21921
2018-07-19 14:13:03 +02:00
Tamás Zolnai
e1b22eaac3 Calculate TilesOnFly limit based on visible area
Use 10 as a minimum value.

Change-Id: I9442a427fd25e1a7a32c3d1d06aa34d2c4ca2472
2018-07-19 14:12:52 +02:00
Tamás Zolnai
2fda5f7d92 Use an upper limit for number of tiles we push to the network
I used number 25 as this limit. It's an approximate value. It's enough
to handle the first 5-10 character input without waiting for tileprocessed
messages. After the first 5-10 characters the tileprocessed messages are
arriving continuously (same frequency as the typing speed), so for the later
character inputs we always have some tileprocessed messages arrived so
we can push new tiles to the network again.
This 25 upper limit also seems enough to send all tiles when a whole page is
requested (e.g. zoom os scroll).

We store the requested tiles in a list, used as a queue. I don't use std::queue
because sometimes we need to do deduplication (replace older versions of the
same tile with a newer version).

Change-Id: I22ff3e35c8ded6001c7fc160abdc1f1b12ce3bae
2018-07-19 14:12:41 +02:00
Tamás Zolnai
4e2b50dc0f Check whether tile rendering request was already sent
Change-Id: Iceb559106dcd95d6ff7db67df76cdfb04f9fb7e0
2018-07-19 14:12:27 +02:00
Tamás Zolnai
6c4e4440e8 Handle part number a bit more robust in case of Writer
Change-Id: I7390f1c5f4289be67deacf3540068c040b230584
2018-07-19 14:12:15 +02:00
Tamás Zolnai
7428c46efe In Impress setpart message's syntax is a bit different.
Two alternative sytnax:
"setpart part=1"
"setpart 1"

Change-Id: I42683ca46d642d56cfc3dcc52a10d69a3f00462b
2018-07-19 14:12:02 +02:00
Tamás Zolnai
29df46219c Need to extract the initial part id from status message
Change-Id: Ia0651d93fedb71d3ca1e24d0356ac179e95e907e
2018-07-19 14:11:36 +02:00
Tamás Zolnai
85f96bc281 Store sent tiles's id instead of using a simple counter
Change-Id: I8cbf84923a53fb6b294bd4039eb7382326f8c445
2018-07-19 14:11:18 +02:00
Tamás Zolnai
464dd72e1c We might need to rerequest tile rendering when we are at sending them
Change-Id: I0551e51c5f5023931dad13435b4ac3517fc48931
2018-07-19 14:11:02 +02:00
Tamás Zolnai
a9c5ea9022 Add a timeout for tileprocessed message handling
For debug purposes.

Change-Id: Icc9dfc05b18f9da96b29b7cadeb57f7218832295
2018-07-19 14:10:22 +02: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
Tamás Zolnai
57cdd68fcf Request new tiles in wsd by invalidateTiles message
And don't wait for the client to send back a tilecombine
request.

Change-Id: I9ea5de0f6b12dfaaf61992d34735d5b78ea382ed
2018-07-19 14:09:49 +02:00
Tamás Zolnai
161695eb66 Store client's visible are information in wsd
Change-Id: Iec3c146181b7db2e76247d5775076e6ac90eed2c
2018-07-19 14:09:33 +02:00
Pranav Kant
6f8b15dfa8 wsd: missing include
Change-Id: I561db86b4b46f1cff0d9f0c744c556d9ec74291f
2018-07-16 10:34:24 +05:30
Tor Lillqvist
3a9e536dfa When asked to convert to PNG, look for an embedded ODF thumbnail first
Change-Id: Ib777572fe5f79b1cfdd95ec3a7f84484a13ae145
2018-07-12 19:27:54 +03:00
Tor Lillqvist
405b66c8db Add a cache of "thumbnails" (PNG images) generated using the convert-to API
When asked to "convert" a document to a PNG image, i.e. what one can
call a thumbnail, check if we have a cached PNG for the same docuemnt
already, and in that case return it.

When we have done such a convert-to operation to PNG, save the result
in the cache for later re-use.

This change adds no thumbnail cache cleanup mechanism. That will have
to be implemented separately using a cron job or whatever.

There are further improvement possibilities: For instance, if the
document is of a type that contains an embedded thumbnail (like ODF),
just extract and return that. For ODF that embedded thumbnail even
already is in PNG format.

Change-Id: I882efe97acc1d81041dc7a4ccb222995940e4836
Reviewed-on: https://gerrit.libreoffice.org/57345
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Tor Lillqvist <tml@collabora.com>
2018-07-12 18:27:23 +02:00
Tor Lillqvist
3b4269a301 Use Util::symbolicErrno()
I think the general policy should be to always log errno using both
Util::symbolicErrno() and std::strerror(), never log a naked errno.
But only in cases where we know that it is highly likely that it is
the most recent system call that has failed, so errno makes sense.

Change-Id: I4a1fb31e375ea949e7da17687464361efe7c1761
2018-07-11 13:05:22 +03:00
Tor Lillqvist
1c09d4a607 Improve logging a bit
Log all error: cases in ClientSession::handleKitToClientMessage(), not
just the case of cmd=load with kind= some password failure.

Change-Id: I53c959068f5642ae41157e8feb14fd34fc59dc9a
2018-07-11 12:33:42 +03:00
Tor Lillqvist
32036fcadf We can pass a std::string directly to LOG_ERR()
Change-Id: I10027e680ad009eb04e44913323ca91c61821b87
2018-07-10 23:14:51 +03:00
Miklos Vajna
8ad281e12f wsd: avoid unnecessary value parameter 2018-07-09 09:11:20 +02:00
Jérémie Lesage
238b754f2b add docKey in documents response 2018-06-29 18:10:25 +01:00
Jérémie Lesage
f084ea53f6 Ensure all sessions have a sessionId and are subscribed.
Simplify constructors, and factor out subscription code.

Change-Id: I4f3ed1eb06abec193d6db1f7c78815ffe1e1b5aa
2018-06-29 18:10:03 +01:00
Pranav Kant
8156c2a8f1 wsd: in case of multiple query param, handle &attachment= correctly
In case of integration with OC/NC, we have WOPISrc= as query param used
for load balancing. So, the earlier approach failed with integration.

Change-Id: Ib73f4f18eaec870dd53b67886b1b6016416a2e78
Reviewed-on: https://gerrit.libreoffice.org/56531
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2018-06-28 18:45:57 +02:00
Michael Meeks
a521527777 Fix logging a little.
Change-Id: I858ffb40e071eae3907eeff9c2d6291fd805dc02
2018-06-15 17:38:12 +01:00
Jan Holesovsky
b65894b287 Avoid crash in the non-wopi case.
Change-Id: I87aff462dab4abca0235622493f720eacbc39f03
Reviewed-on: https://gerrit.libreoffice.org/53448
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2018-06-14 17:01:02 +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
Ashod Nakashian
d3d4812583 wsd: localize variables
Change-Id: I411e435fa2360423b4c48d087eb501b942cc637d
Reviewed-on: https://gerrit.libreoffice.org/52419
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2018-06-14 16:52:49 +02:00