Commit graph

919 commits

Author SHA1 Message Date
Tamás Zolnai
9683f53a9c Filter out tiles by wired on wsd side too
Some times tiles with the same wireID survives the wireID
filtering in kit, so we should do that in wsd too.
The issue is with the tilesBeingRendered construction. First when
one tile is filtered out on kit side the client remains subcribed
to the tile, since wsd does not know filtering happened.
Second via the tilesBeingRendered object more clients can be subcribed
to the same tile and so when one client request a new version of this
tile (with an old wireID) the rendered tile is sent to all subscribed
clients even if the other clients has up-to-date tiles.

Change-Id: I4ca6b7a83a5d6979a9f924d766a71aba5e5362c7
2018-09-29 09:27:06 +02:00
Tamás Zolnai
a1a0bf3718 Don't send tiles which was changed outside of the visible area
Since this commit:
9473908d45
We can avoid that, because the tiles will be invalidated
on the client side and when the client visible area changes
the invalidated tiles are requested anyway.

Change-Id: I272e3b4b87380ae574c16a2b480dbc8caabf4b32
2018-09-29 09:27:06 +02:00
Tamás Zolnai
07e99ad336 Fix tilesBeingRendered tracking by client
I changed the code in this commit:
c2a5f6acb0

To make kit send a tilecombine message even if it does not
send actual tile data so we can track that the rendering was
done and so we can update the clients' _tilesBeingRendered
list. The issue is that tileBeingRendered object
belongs to not only one client, but more and so we don't
know which client gets the actual empty tile response.

So revert this method and rather use a smaller timeout for "waiting" the
arrival of the rendered tile.

Change-Id: I2dbbab1a62b81cbbb5314f2f37fdbc3415c69130
2018-09-29 09:27:06 +02:00
Tamás Zolnai
5260eae05f Avoid rendering / sending the same tile twice
When we're doing the prerendering we also need to register
a tileBeingRendered object, so we know that the given tile
will arrive soon. In earlier version of the code, rendering
and sending of the tile was not separated in time, but now it is,
so we need create a tileBeingRendered object even if we don't
subscribe the client to it yet.

Change-Id: I1374c22e5ffebe1d6fcc6e37261ddcedeb9066ec
2018-09-29 09:27:06 +02:00
Tamás Zolnai
b623aca57e Use a bigger timeout for waiting tileprocessed message
The main purpose of this time-out is to avoid waiting forever for lost
tile messages, but since it rare to loose them we can use bigger value,
so we can avoid to send new tiles to a slow network.

Note that the used time stamp does not mean the time when the tile
actually send to the client, but the time when it gets to the sender
queue.

Change-Id: I230d85c38b3a5dafd195851d0cf4caac23149e3e
2018-09-21 16:04:53 +02:00
Tamás Zolnai
0807d04934 Convert this warning to info
There valid cases when we get unknown tileID. For example we
sent some tiles, but in the meantime canceltiles arrives which
resets tiles-on-fly list, but the client still send tileprocessed
messages for earlier requested tiles.

Change-Id: If2ec015106a0e58d66ae4517b64a9552eb8c38fc
2018-09-21 16:01:44 +02:00
Tamás Zolnai
4b13430f6d Fix warning: in case of a text document part number has no meaning
In this case the part number is undefined, somewhere it is set to 0 or 1,
but has no meaning at all. Just avoid using it with text ducments.

Change-Id: Ic98217bf3ea6c86d37c34e42302bf456f7274975
2018-09-21 16:01:44 +02: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
Tor Lillqvist
75438baa70 More mobile app stuff, very much early state of work in progress
Re-think Linux vs mobile ifdefs a bit. Use #ifdef __linux only to
surround code that actually is Linux-specific. Use #ifdef MOBILEAPP
for code that is for a mobile version (with no separste wsd, forkit,
and kit processes, and with no WebSocket protocol used).

Bypass UnitFoo for mobile. Possibly we do want the UnitFoo stuff after
all on mobile, to run in some special testing mode? Hard to say, let's
skipt it for now.
2018-09-10 15:13:43 +03:00
Jan Holesovsky
5ae112d563 ServiceRoot: Fix the admin console (the jwt token generation).
Change-Id: Ic1772692471d29c99d7d68834cddb6b304e721d2
2018-09-08 00:12:20 +02:00
Jan Holesovsky
7152a8a55c ServiceRoot: Fix the branding and update the admin console debug URL.
Change-Id: Id10d7a4d99ea993a398467e528e2018cc12d503b
2018-09-08 00:12:20 +02:00
Jan Holesovsky
c5259eb7b6 ServiceRoot: Add the serviceRoot to various html and js files.
Change-Id: Ibd9093afa3d1f014c70328446ee42189dd0c2117
2018-09-08 00:12:20 +02:00
Jan Holesovsky
9d07230f8a ServiceRoot: Allow prefixing all the URI paths with a given prefix.
For instances that has to run in a deeper path like
https://server/something/blah/loleaflet/HASH/loleaflet.html.

Change-Id: Idacdaf9087d682fd527c3af2ea45d6b51a33908e
2018-09-08 00:12:15 +02:00
Tor Lillqvist
496bf321a7 Make this file compile for iOS 2018-09-04 12:17:46 +03:00
Tor Lillqvist
10c302f047 Make std::chrono usage more portable
Add a std::chrono::time_point_cast to get it to compile against libc++
(for iOS).
2018-09-04 12:12:35 +03:00
Tor Lillqvist
0e9f5eba96 Make this file compile for iOS
Note that I don't claim this file would make much sense for iOS as
such at the moment. I just want it to compile for now. This holds for
all my other recent commits with the same 'Make this file compile for
iOS' commit message.
2018-09-04 12:04:07 +03:00
Tamás Zolnai
14537846a8 Handle unset client visible area case while calculating tiles-on-fly limit
Change-Id: I25ea6f1efdc8115304d5449cfccdbb5c0c15fb1f
2018-09-03 16:35:00 +02:00
Tamás Zolnai
dce6c18fb4 Calculate tiles-on-fly limit a bit more precisely
Change-Id: Id012a83d6ccd226d1b66e3cd48a9caeafd849fc5
2018-08-30 18:42:55 +02:00
Tamás Zolnai
1b01af3605 First forward invalidation to client and request tiles after 2018-08-26 06:49:34 +02:00
Tamás Zolnai
185b933353 Go back using list for tilesOnFly
It can handle duplicates which we need to have.

Change-Id: Ia4cd813dd173bc538dd27953c4886d460b5b1c49
2018-08-23 13:44:39 +02:00
Tamás Zolnai
3bd7c6b508 Fix previous commit
Change-Id: I7d3bce0132d124e52f7885c8cb3c26acc6f7b41d
2018-08-23 13:04:48 +02:00
Tamás Zolnai
759d1fe722 Drop too old tileID's from tiles-on-fly list
So we can avoid that tile sending stop working because server is
waiting for tileprocessed messages which will not arrive.

Change-Id: I545346c50d49340999608aadac32b5190ede43c5
2018-08-23 12:47:52 +02:00
YiiChang Yen
3e202e8ed1 ossii# wsd: Add lost config settings for default value.
We lost default value for(POCO setting) but loolwsd.xml had:

pureAge, purgeCount, rotationOnOpen and archive

so set them.

Change-Id: If6fc071884e77cd4e67412e9db66cf17ddbbb4ce
Reviewed-on: https://gerrit.libreoffice.org/57474
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
2018-08-23 09:52:28 +02:00
Tamás Zolnai
3ca4421eb7 Updated deduplicated tiles wireID
Change-Id: Ia901d8831792de1bee6b21017be02fa1e744e2ee
2018-08-22 23:20:27 +02:00
Tamás Zolnai
54596dbcf9 Reset also the wireId map by canceltiles 2018-08-22 16:53:07 +02:00
Tamás Zolnai
d0fb39cd76 Handle negativ position value of clientvisiblearea
Change-Id: I1bf1217e038d034167e1a5412d81a311ebbd83ed
2018-08-22 16:53:01 +02:00
Tamás Zolnai
25e1a01a3c Handle tiles hanging out the visible area
A problem comes up when only a part of the tile is visible
on the client side and invalidation affects the invisible
part of this tile. To get back the old / right behavior we
need to request this kind of tiles too.
2018-08-22 13:49:23 +02:00
Tamás Zolnai
fd87e1e315 Crash: Check whether we still have requested tiles
Change-Id: I2a8b9ced09ff624ce925b52a60352e6fa50af25e
Reviewed-on: https://gerrit.libreoffice.org/59334
Reviewed-by: Aron Budea <aron.budea@collabora.com>
Tested-by: Aron Budea <aron.budea@collabora.com>
2018-08-20 18:19:54 +02:00
Tomaž Vajngerl
cfab70c48b get rid of boost::optional
We don't check if boost is available in the configure phase so we
can't use it. It is possible to add it but as we only use it in
one place and it is actually not really needed, it is better to
remove the usage.

This change also moves the std::list to std::deque.

Change-Id: I4c661a2fb8995bf756a0815a6e30bb304f22d3c8
Reviewed-on: https://gerrit.libreoffice.org/58640
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2018-08-20 17:43:44 +02:00
Tamás Zolnai
7d98b5f015 Revert "Get back "Cancel tiles also in wsd's senderqueue""
This reverts commit f1a385be98.

It's not easy, it can interfere the tile tracking.

Change-Id: I1e4ec9b4d66e5e912873f673fd5cb71ba55a9332
Reviewed-on: https://gerrit.libreoffice.org/59326
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com>
2018-08-20 15:13:59 +02:00
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