Commit graph

3825 commits

Author SHA1 Message Date
Ashod Nakashian
9640fd1e78 loolwsd: handle invalidatetiles in DocumentBroker
Change-Id: I05e70f82af9b5c8bdb590a64688ffa70c6ba2034
Reviewed-on: https://gerrit.libreoffice.org/29124
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-21 05:17:27 +00:00
Ashod Nakashian
87a9f6e166 loolwsd: don't remove subscriptions on invalidation
Tile invalidation is a hint to the clients to request
fresh tiles and replace the existing ones. However
any outstanding tile request will be rendered anew.
So no need to remove those.

Nonetheless, we should issue new versions to avoid
race between old tile and invalidate. This can
happen when a tile rendered just before invalidate
reaches the client after the invalidate. The client
will think the tile is a new one when it was rendered
just before the invalidate.

Change-Id: Ieb2ffab1214dd904da8e532e7d9d20e6ad783b78
Reviewed-on: https://gerrit.libreoffice.org/29123
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-21 05:16:57 +00:00
Ashod Nakashian
14f11460b6 loolwsd: new multi-view canceltiles unittest
Change-Id: Ia7fdc2c64c96e3edeb82ef48d3621b70ca958b5d
Reviewed-on: https://gerrit.libreoffice.org/29122
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-21 05:16:21 +00:00
Ashod Nakashian
d4a8177803 loolwsd: better timeout handling in unittests
Change-Id: Ib9a002cb25eda12335727bef56f7e2d48d682438
Reviewed-on: https://gerrit.libreoffice.org/29121
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-21 05:15:55 +00:00
Ashod Nakashian
0326aa4304 loolwsd: cancel individual tiles
Change-Id: I18faee319fc12de2151460afbb054b8509578579
Reviewed-on: https://gerrit.libreoffice.org/29120
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-21 05:15:30 +00:00
Ashod Nakashian
9e5df31cbb loolwsd: make sure to combine all contiguous tiles
Change-Id: If65e2ff53f593015ba7df23b6943a711c36550de
Reviewed-on: https://gerrit.libreoffice.org/29119
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-21 05:14:41 +00:00
Ashod Nakashian
6bf643183e loolwsd: cancel subscriber tiles only
Change-Id: I207f2332520f29308a2994769aa3a12ea5178477
Reviewed-on: https://gerrit.libreoffice.org/29118
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-21 05:14:03 +00:00
Ashod Nakashian
8f213bc170 loolwsd: canceltiles re-designed using tilecache instead of queue
Reviewed-on: https://gerrit.libreoffice.org/28526
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
(cherry picked from commit 571ff06906)

Change-Id: Ie8f2c87a705aac14dd6f139c384f000df98db909
Reviewed-on: https://gerrit.libreoffice.org/29117
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-21 05:13:18 +00:00
Ashod Nakashian
836219d269 loolwsd: unittests for combined rendering
Change-Id: I164942c1b14727c2f1707341d625c3b4bfc3f672
Reviewed-on: https://gerrit.libreoffice.org/29116
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-21 05:10:31 +00:00
Ashod Nakashian
e9f37433d7 loolwsd: combine tiles before rendering to reduce latency
Change-Id: I5af2d2a9ddf3b5a3db5bc5f0835687d7cae5b17c
Reviewed-on: https://gerrit.libreoffice.org/29115
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-21 04:59:49 +00:00
Ashod Nakashian
cdafb34b53 loolwsd: added impress tiles unittest
Change-Id: I25036f6a9ad77ebd06991866245e89c1045fbea3
Reviewed-on: https://gerrit.libreoffice.org/29114
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-21 04:48:35 +00:00
Tor Lillqvist
b7aa479120 Add configure options to use a self-built cppunit
I wanted to try loolwsd built with _GLIBCXX_DEBUG defined and thus
needed cppunit built like that, too. (And Poco, but we already had
configury to point to a self-built Poco.)
2016-09-20 20:32:30 +03:00
Ashod Nakashian
3b2055a0a8 loolwsd: remove the callback descriptor after destroyView
On destroyView Core must flush the events queue, otherwise
by the next idle the descriptor will be gone and we'll
be using freed memory.

Change-Id: I6d3d8f9461bc156383a7294e9c65c535d79f2e7a
Reviewed-on: https://gerrit.libreoffice.org/29088
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-20 11:58:20 +00:00
László Németh
fb351f2c1a add client-side tile debugging mode
Extending the document URL with debug=1 option will switch

- visible tile boundaries
- update numbers over tiles

and invalidated tiles will be blue during waiting for an update.
2016-09-20 13:22:36 +02:00
Tor Lillqvist
90c7b553ed Don't erase the CallbackDescriptor record before turning off callbacks
Seems to fix the deadlock problem, or at least makes it very much
rarer. (I am not entirely certain that a callback might not be in
progress already (in another thread) when we turn off callbacks, and
in that case the callback might still then access freed memory?)
2016-09-20 13:32:43 +03:00
Tor Lillqvist
8207412c02 Poco::Thread::current() is not reliable for logging
It can return null for no obvious reason, leading to misleading
logging where the same thread is identified as numer zero at one place
and non-zero at another. So use the actual Linux thread id in logging.

Sure, thread ids are somewhat less convenient, as they are larger
numbers, from the same number space as process ids.
2016-09-20 13:32:43 +03:00
Pranav Kant
f84cad1e8d loleaflet: Fix some cases of leaked connecting spinner
Change-Id: If694e8f699a2a087dad1e36fc3b67960ac294560
2016-09-20 15:18:10 +05:30
Andras Timar
7465853d34 l10n: add src/control/Control.DocumentRepair.js for string extraction to pot file 2016-09-20 09:52:24 +02:00
Miklos Vajna
ef4ca0507a loolwsd: remove takeedit and editlock commands
As a follow-up to commit 77e219ceff
(loleaflet: Kill editlock code, completely, 2016-09-20).

Change-Id: I48a58bb738c0939f99d220eca7a8fd3f4c3debe4
2016-09-20 09:47:25 +02:00
Pranav Kant
77e219ceff loleaflet: Kill editlock code, completely
Editlock buttons have already been removed; most of this code is
unreachable/useless anyways.

Don't listen to editlock messages anymore, and always set the map
permission to edit unless specified.

Change-Id: I2ee672e72beaa48a7c6cd0bbd1c548ff10a251d1
2016-09-20 11:17:20 +05:30
Ashod Nakashian
faf6cf7ce4 loolwsd: better logging in subscribeToTileRendering
Change-Id: I5b94cda02e4f0e1154de81fc7bb4380332f2eeeb
Reviewed-on: https://gerrit.libreoffice.org/29070
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-20 03:34:59 +00:00
Ashod Nakashian
454b2b71c1 loolwsd: don't generate imgsize in tile when 0
Change-Id: I469bdbfbb5efd8230808e6c68f58f505acef3993
Reviewed-on: https://gerrit.libreoffice.org/29069
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-20 03:33:41 +00:00
Ashod Nakashian
ec4b489885 loolwsd: remove unused priority flag from saveTileAndNotify
Change-Id: I49309bb80a6b9e9e8265da8f8db966b98e362f0a
Reviewed-on: https://gerrit.libreoffice.org/29068
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-20 03:32:48 +00:00
Ashod Nakashian
a9fbfe8d8a loolwsd: remove queue thread from child socket handler
Change-Id: Ib6b4890db1f331b2e2cdcfafb57366ff62e3a13d
Reviewed-on: https://gerrit.libreoffice.org/29067
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-20 03:31:31 +00:00
Ashod Nakashian
e7272019dc loolwsd: remove tile queue and simplify tile response
Tile queue was used to process canceltiles commands.
Since those are handled by TileCache, there is no need
for queues and the threads that pump them.

But because these queues were also used to buffer between
WSD internals and clients, such that a slow client wouldn't
block WSD while sending back tiles, it is necessary
to reword that logic.
In subsequent commits that will change as well.

With this change not only do we save a thread per client,
but we also reduce latency of tile, and improve typing
responsiveness, by almost 3x or more! Latencies are
down to ~15ms from almost 50ms.

Reviewed-on: https://gerrit.libreoffice.org/28575
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
(cherry picked from commit 59eaacd2f8)

Change-Id: I77813267a95a724491165792ec020ae00953c05e
Reviewed-on: https://gerrit.libreoffice.org/29066
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-20 03:30:43 +00:00
Ashod Nakashian
1255cc11d8 loolwsd: version each tile and simplify tilecombine request handling
Change-Id: I369b05a747182cb387141d09ecb5098e1dd16901
Reviewed-on: https://gerrit.libreoffice.org/29065
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-20 03:27:34 +00:00
Ashod Nakashian
7a8248875d loolwsd: don't combine tiles by row to allow for better culling
Reviewed-on: https://gerrit.libreoffice.org/28615
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
(cherry picked from commit 99d0ee2ac1)

Change-Id: Ibfe6b7430cbdf78bc13b42d19789ce23226a5a5a
Reviewed-on: https://gerrit.libreoffice.org/29064
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-20 03:26:22 +00:00
Ashod Nakashian
23ef612970 loolwsd: ensure that the connection thread is running
If the connection thread is not running when loading a
document, the callback will drop events. This can happen
when the thread is too slow to spawn, but we return from
the createSession function and process client messages.

This should solve the race where we lose notifications of
other views when a new view is created.

Change-Id: Ia79739889b2f01fbb374d48eb33620084f4ed1c1
Reviewed-on: https://gerrit.libreoffice.org/29063
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-20 03:25:16 +00:00
Ashod Nakashian
53ba8a1307 loolwsd: use std sleep_for rather than POSIX or Poco
Change-Id: Icce28f2ee61035534431bb8b5d7df93b00ad2fc3
Reviewed-on: https://gerrit.libreoffice.org/29062
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-20 03:23:00 +00:00
Ashod Nakashian
bad8ae9ed9 loolwsd: one anonymous namespace per file is enough
Change-Id: I12b4967a321de45fc50ad314775d01499b5edd80
Reviewed-on: https://gerrit.libreoffice.org/29061
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-20 03:21:18 +00:00
Ashod Nakashian
74f796d91a loolwsd: flush trace file on events
This reduces chances of data loss and gives
more up-to-date data to the user.

Also include tile messages in the trace recording,
since they are useful for debugging. Should be
disabled to reduce excessive trace generation.

Change-Id: I223144660698843f4e94564e049883db898c0064
Reviewed-on: https://gerrit.libreoffice.org/29060
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-20 03:20:10 +00:00
Ashod Nakashian
b0f20ea35f loolwsd: proper tracing of outgoing tile messages
Change-Id: I875743cac144bd4bc357038aa58c9cfe7a3988aa
Reviewed-on: https://gerrit.libreoffice.org/29059
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-20 03:18:41 +00:00
Ashod Nakashian
6f7115ebc6 loolwsd: added config for logging to file
Change-Id: Ib4942af2e9875018fbb27e1666912ca8f8b4e901
Reviewed-on: https://gerrit.libreoffice.org/29058
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-20 03:16:45 +00:00
Miklos Vajna
21f8b072f3 Add EMPTY cell cursor testcase
Change-Id: I8d1e86a72eb3383d8d012d884a24233f8ee3079c
2016-09-19 16:58:02 +02:00
Miklos Vajna
ea274bcf6b Document::ViewCallback: don't fail on EMPTY cell cursor
Change-Id: I67bee2a1f1332bfb82963e0fb3a0e761054f826e
2016-09-19 16:04:23 +02:00
Ashod Nakashian
e1cd116abd loolwsd: duplicate command name removed
Change-Id: Iad7b440ec4ab30e832cf3ae2d4c64760fcb1db5d
Reviewed-on: https://gerrit.libreoffice.org/29022
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-19 12:13:35 +00:00
Ashod Nakashian
7fff960391 loolwsd: stop the tile-queue when exiting
Change-Id: I49276c9639e8826d145a31eb476b41eb64baf88a
Reviewed-on: https://gerrit.libreoffice.org/29009
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-19 12:03:57 +00:00
Ashod Nakashian
d1d5bf28e7 loolwsd: log sender/receiver in inactiveClient unittest
Change-Id: I138eb19d5252472edad5272b2764a7c263a224e4
Reviewed-on: https://gerrit.libreoffice.org/29008
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-19 12:03:37 +00:00
Ashod Nakashian
1fc7ec0be5 loolwsd: add graphicviewselection to expected messages in unittests
Change-Id: I2f2e009c970839f380d7501c7a45ffdc0936e5f7
Reviewed-on: https://gerrit.libreoffice.org/29007
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-19 12:03:19 +00:00
Ashod Nakashian
258b768218 loolwsd: break receiveFrame on TerminationFlag
Change-Id: Id6d71951660431abea1a393fc7fe91a88552fc04
Reviewed-on: https://gerrit.libreoffice.org/29006
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-19 11:59:43 +00:00
Ashod Nakashian
f0c09238ce loolwsd: fail fast rather than catch all
Change-Id: Ib38924bf823315d211eb467d90f364fdc225ba2e
Reviewed-on: https://gerrit.libreoffice.org/29005
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-19 11:59:23 +00:00
Ashod Nakashian
88fb1e1978 loolwsd: gitignore auto-complete and yavide dot files
Change-Id: Ied01b78c76478d980947f6c5dd595809e515ae4f
Reviewed-on: https://gerrit.libreoffice.org/29004
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-19 11:58:59 +00:00
Tor Lillqvist
f24417127c Avoid a couple of pointless const variables used just once
I truly cannot understand what purpose using these variables served.
2016-09-19 14:02:05 +03:00
Tor Lillqvist
d654c464df Don't log the contents of CLOSE frames 2016-09-19 13:53:14 +03:00
Tor Lillqvist
2f12308ca2 Presumably a graphicviewselection: message is OK, too
Fixes the testInactiveClient unit test.
2016-09-19 13:20:09 +03:00
Tor Lillqvist
1febbe72ae Sort lines for sanity 2016-09-19 13:20:09 +03:00
Pranav Kant
1fbceb9f68 loolwsd: Forward REDLINE_TABLE_ENTRY_MODIFIED messages
Change-Id: Ib666c1ebf9165c795fcefb56a2ea3919d60c8ac4
2016-09-19 14:48:27 +05:30
Pranav Kant
f5a9e8e33d loleaflet: l10n: Repair Document
Change-Id: I3b320547a25094fbfa2d1538b4fa1e91b2cf41ad
2016-09-19 14:48:27 +05:30
Tor Lillqvist
df3cc99025 Don't require the LOK_VIEW_CALLLBACK env var any more
Act as if it was always set.

The ChildSession::_multiView field will always be true, so factor it
out. Ditto for Document::_multiView.

The ClientSession::_haveEditLock will also be always true, so factor
it out. This means the ClientSession::isEditLocked() will always
return true, so factor it out, too.

ClientSession::markEditLock() always will always set _haveEditLock to
true (which it will be from the constructor already anyway) so it can
be removed.

ClientSession::setEditLock() does not need a parameter as the
parameter was actually only used for misleading logging. The msg
variable constructed in the function used isEditLocked(), not the
parameter.

We still generate and handle editlock messages. Not sure whether that
makes any sense, though.
2016-09-19 12:13:00 +03:00
Miklos Vajna
e2029921cb LOOLStress: avoid multiplying at int precision, then converting to long
Change-Id: Ie79296522d09be0f337f218bede1a28e9bac3a7c
2016-09-19 09:22:01 +02:00