Commit graph

3552 commits

Author SHA1 Message Date
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
Henry Castro
c6c2040849 loolwsd: test: log more info for each view 2016-09-17 18:13:56 -04:00
Henry Castro
a613025b0e loolwsd: test: add view name verbose 2016-09-17 18:13:32 -04:00
Henry Castro
7243e485d0 loolwsd: assign view id after loading
When session, it is not assigned, ViewCallback thread
will not enqueue the message
2016-09-17 18:13:05 -04:00
Henry Castro
722ca5daf5 loolwsd: log: warn lost messages 2016-09-17 18:12:44 -04:00
Tor Lillqvist
20d6acae29 Return true in LOOLSession::forwardToPeer() when peer is closing
Fixes the testEditAnnotationWriter unit test, and doesn't break any
other ones. Many other tests do fail, but they fail also without this
change.
2016-09-16 18:28:21 +03:00
Tor Lillqvist
fbd738c32a One more 2016-09-16 16:45:07 +03:00
Miklos Vajna
784f2eb94c Update bundled LibreOfficeKit include files
Change-Id: I8f08c3b22d81b81ba8dc13398269cd4b8e75aaf6
2016-09-16 14:50:32 +02:00
Ashod Nakashian
3d9b50aeeb loolwsd: unittest runner improvement and logging
Change-Id: I4ddce1775b620e9140366ae7965b37b6cce8689e
Reviewed-on: https://gerrit.libreoffice.org/28958
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-16 12:37:52 +00:00
Ashod Nakashian
b26b52af61 loolwsd: unittest for tile prioritization
Change-Id: Ib5ea6b94d651124106069f8d796b7359c92639a8
Reviewed-on: https://gerrit.libreoffice.org/28957
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-16 12:36:10 +00:00
Ashod Nakashian
ffa146a870 loolwsd: log tile version in stats
Change-Id: Ia8a466b50f5236cb555c962830843c4d7d77fa97
Reviewed-on: https://gerrit.libreoffice.org/28956
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-16 12:32:22 +00:00
Ashod Nakashian
d2872846d8 loolwsd: cleanup of unittests and helpers
Change-Id: I03a5cb29b51409f3b8cc51981b522248a29a6ba3
Reviewed-on: https://gerrit.libreoffice.org/28955
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-16 12:31:59 +00:00
Ashod Nakashian
67c05ec319 loolstress: improved benchmarking and stats
Change-Id: I8b9c2879dbc3ebc37df27eb5c4138bf48c4408c2
Reviewed-on: https://gerrit.libreoffice.org/28954
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-16 12:31:35 +00:00
Ashod Nakashian
a0478719ff loolwsd: benchmark iterations count as argument to the cli
Change-Id: I2598937ec01dbc4672f88f86d642b32b1b000d91
Reviewed-on: https://gerrit.libreoffice.org/28953
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-16 12:31:13 +00:00
Ashod Nakashian
fcb7da4c76 loolstress: cout <-> cerr
Change-Id: I5bd530ccddab357054a9093bec54807a649dbe05
Reviewed-on: https://gerrit.libreoffice.org/28952
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-16 12:30:55 +00:00
Miklos Vajna
3d27e285b6 lok::Document: rename getViews() to getViewsCount()
Adapt client code to the changed core.git API.

Change-Id: I752d27919b7983909c8e96900115cca26bac11c6
2016-09-16 12:32:19 +02:00
Tor Lillqvist
8518620ddd Try to unify format of log messages a tiny bit
Lots more of that to do if one could be bothered. Just some details I
noticed in passing.
2016-09-16 13:09:00 +03:00
Tor Lillqvist
42fdb3b079 Drop always-defaulted 'timeoutMs' parameter to countLoolKitProcesses()
Also, drop the pointless use of POLL_TIMEOUT_MS, we first multiplied by
it and then divided.
2016-09-16 12:52:55 +03:00
Tor Lillqvist
941f400e71 Minor comment fix 2016-09-16 12:03:57 +03:00
Tor Lillqvist
9d03ff2946 No need to include ChildSession.hpp here 2016-09-16 11:25:06 +03:00
Tor Lillqvist
4799bcc73e Clarify comments about the meaning of the three LOOLSession subclasses
Be careful in using the definite article for classes that are
instantiated as singletons in a process, and otherwise an indefinite
article. Also mention in which process objects of the type in question
exist.
2016-09-16 11:24:35 +03:00
Tor Lillqvist
9d17637488 Fix comment 2016-09-16 11:24:12 +03:00
Henry Castro
f1b54a3f57 loleaflet: add border color to L.Popup 2016-09-15 17:21:33 -04:00
Henry Castro
9ef5eaee88 loolwsd: ignore .dirstamp 2016-09-15 16:05:34 -04:00