Commit graph

2365 commits

Author SHA1 Message Date
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
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
9ef5eaee88 loolwsd: ignore .dirstamp 2016-09-15 16:05:34 -04:00
Henry Castro
4d6fadfc0b loolwsd: test: simplify each view 2016-09-15 16:00:02 -04:00
Tor Lillqvist
d170a0c774 Remove some ASCII art 2016-09-15 21:32:35 +03:00
Tor Lillqvist
4197bc5881 Don't hide errors behind a bogus default
If TDOC is not defined, this is broken. Defining it as "" in that case
won't fix anything. Use abs_top_srcdir to be less dependent on what
the cwd is when the code runs.
2016-09-15 21:32:35 +03:00
Henry Castro
a97d6f5449 loolwsd: test: graphic view selection 2016-09-15 14:14:49 -04:00
Jan Holesovsky
a6f70aad79 bccu#2005 follow-up: Another place where we need the dummy document broker.
I think this is another potential race condition...
2016-09-15 17:48:01 +02:00
Jan Holesovsky
10392f9ba6 Decrease the level of indentation. 2016-09-15 17:22:28 +02:00
Jan Holesovsky
d1e0b978d6 bccu#2005 follow-up: If the document appearead in the meantime, finish early. 2016-09-15 16:36:29 +02:00
Marco Cecchetti
80153826db Revert "loolwsd: we use callbacks latch for not missing messages sent very early"
This reverts commit ed983f17cb.

Conflicts:
	loolwsd/bundled/include/LibreOfficeKit/LibreOfficeKit.h

Change-Id: Ia85b4d9223e9918dd33a66b8d6aeb0c3a1516a3c
Reviewed-on: https://gerrit.libreoffice.org/28904
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-15 13:23:39 +00:00
Jan Holesovsky
27bed804d5 bccu#2005: Make sure we don't create 2 jails for the same document.
When 2 users opened the document at the very same time, it happened that new
jails / instances were created for the document twice.

As a solution, insert a dummy (marked to destroy) document into the map of
DocumentBrokers, which will lead into synchronization between the two
instances.

[I suppose the synchronization did not work previously either, as emplace()
does not seem to modify the value when the key is already in the map.]
2016-09-15 12:50:26 +02:00
Miklos Vajna
27220aea39 test helpers: avoid unnecessary copies
Change-Id: I014cedcc10078ce03d1f4f3ae9403b6282b7dcac
2016-09-15 10:33:26 +02:00
Ashod Nakashian
c01629ab2a loolwsd: only prioritize tile messages and not tilecombine
Change-Id: Ia292e5b499dd4409dc3a672e4d5360c868d6c71f
2016-09-14 23:20:12 +01:00
Ashod Nakashian
ad6d77cd3b loolwsd: remove cursor of unloading views
Change-Id: I4281a5aa101f034007aa227bb18b14eeba806ea0
2016-09-14 23:19:56 +01:00
Ashod Nakashian
2db1db06c7 loolwsd: queue -> tileQueue
Change-Id: If61de6807fa7f52a703fe45948df911fe162f69a
2016-09-14 23:19:45 +01:00
Ashod Nakashian
ece87da287 loolwsd: tile prioritization per view cursor
Change-Id: I1410b64982ac2db04e5a47d744a95b8d2eab5f7e
2016-09-14 23:19:38 +01:00
Michael Meeks
787ee1d2d2 Revert "loolwsd: don't combine tiles by row to allow for better culling"
This breaks combine-tiles very significantly, viewing images
in documents with this appears to show each tile scaling and
rendering individually.

This reverts commit 99d0ee2ac1.
2016-09-14 22:15:43 +01:00
Miklos Vajna
a652a013aa LOOLStress: unused using declaration
Change-Id: If20c38a4575074e7ca30069115002aadd1a1847f
2016-09-14 09:20:55 +02:00
Miklos Vajna
74a29c4ee4 MessageQueue: avoid allocation of unnecessary temporary strings
Change-Id: I9162407020d84d0c92c9d1c6dfab806c67f3b873
2016-09-13 08:41:51 +02:00
Tor Lillqvist
c56888159a Update to match core master
Just two small comment and whitespace changes.
2016-09-12 13:09:08 +03:00
Miklos Vajna
6006e22001 LOOLKit: use std::move() in Document ctor
Change-Id: I25aeb5285465385858180747f441a69b858c4fe6
2016-09-12 08:15:37 +02:00
Marco Cecchetti
ed983f17cb loolwsd: we use callbacks latch for not missing messages sent very early
- lok::Document::setCallbackLatch: used on doument loading for
set/unset the latch

- now cell cursors of other views are correctly notified to the new
view
2016-09-10 21:28:11 +02:00
Marco Cecchetti
edc1302f16 Revert "loolwsd: we use callbacks latch for not missing messages sent very early"
This reverts commit f2106157f3.
2016-09-10 20:51:59 +02:00
Marco Cecchetti
f2106157f3 loolwsd: we use callbacks latch for not missing messages sent very early
- lok::Document::setCallbackLatch: used by a child session for
set/unset the latch

- lok::Document::registerCallback has a new boolean parameter used for
setting the latch state just before the callback is actually
registered for a (new) view

- now cell cursors of other views are correctly notified to the new
view
2016-09-09 22:23:51 +02:00
Henry Castro
e9f3fd4e56 loolwsd: test: cell view cursor 2016-09-08 12:16:51 -04:00
Henry Castro
f751d36c8f loolwsd: test: view cursor visible 2016-09-08 10:27:42 -04:00
Pranav Kant
33a5c4bc70 Fix comment
Change-Id: Ib43bcc7378590e71b98856c11218fd99ad90d32d
2016-09-07 21:47:11 +02:00
Henry Castro
d4d764cee5 loolwsd: test: invalidate view cursor 2016-09-07 12:21:34 -04:00
Pranav Kant
1b0088ab69 loolwsd: Comments
Change-Id: Ia4e91f18d695ac2249fa1139afbcb5b3f65f87ba
2016-09-07 11:37:12 +02:00
Pranav Kant
3f421be4da loolwsd: Code reuse, and don't send 'remview' message to inactive clients
Use the existing function notifyOtherSessions() to broadcast the
message.

The function also takes care of sending this message only to
active clients.

Change-Id: I98d40429de17463167a67cb10ba59381a0cbc525
2016-09-07 09:20:37 +02:00
Pranav Kant
9edb1c2994 loolwsd: Don't send addview notification to inactive clients
Change-Id: I4771e4bf12057fdc7099e9433d3b7dc2198cb265
2016-09-07 09:20:37 +02:00
Tor Lillqvist
c4733fd4d2 Revert "Mention --without-system-nss"
That is the default anyway.

This reverts commit 894b0a11b0.
2016-09-02 15:15:40 +03:00
Tor Lillqvist
894b0a11b0 Mention --without-system-nss 2016-09-02 15:08:49 +03:00
Ashod Nakashian
99d0ee2ac1 loolwsd: don't combine tiles by row to allow for better culling
Change-Id: I30c0a9caad51bd77360a97c9f5899742385ccc27
Reviewed-on: https://gerrit.libreoffice.org/28615
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-02 11:30:42 +00:00
Ashod Nakashian
2663f9b63f loolwsd: replace old tile requests with more recent ones
A new queue with own thread now processes tile requests
so we have a chance to cull backlogged tile requests
that have since been invalidated.

This reduces load on the server significantly, especially
with multiple view at different zoom levels, and very fast
typing.

Change-Id: I6599939cd363dc71c30187f40d542aa37260dc56
Reviewed-on: https://gerrit.libreoffice.org/28607
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-01 20:47:10 +00:00
Michael Meeks
6bce292c44 Send intermediate tiles back even when we they are older.
Should improve interactivity and avoid jerky feedback.
2016-09-01 21:18:38 +01:00
Michael Meeks
8182dd8c54 Assign priority based on intersection with the cursor.
Should help to reduce visual tearing when cursor spans a tile join.
2016-09-01 21:18:38 +01:00
Pranav Kant
c43c5486fa loolwsd: Fix build
Change-Id: If55ad5dfe3f16c9cf4d15d57d199c392d8814e24
2016-09-02 00:41:41 +05:30
Tor Lillqvist
a970587053 Ignore unexpected TimeoutException from receiveFrame() in SocketProcessor()
Seems to get rid of some (maybe all) "unexpected connection error"
issues for me at least.
2016-09-01 19:47:45 +03:00
Jan Holesovsky
e41e107500 Fix --disable-ssl case. 2016-09-01 16:24:35 +02:00
Tor Lillqvist
be4e71c0f0 Fix misleading logging
Don't mention 'TerminationFlag' in the log line when that lovely
global variable isn't what we are logging there (but the local 'stop'
boolean variable). Also, output its value as "true" or "false", not
numerically.
2016-09-01 17:16:46 +03:00
Tor Lillqvist
eb4b4b6ca0 Remove leftover unused field Connection::_stop
Not sure what the stop() function should do now, if anything. Maybe
_stop should be kept and actually tested somewhere, like in the third
lambda passed to IoUtil::SocketProcessor() in Connection::run()?
2016-09-01 17:04:05 +03:00
Ashod Nakashian
f4c0a87991 Revert "loolwsd: remove queue thread from child socket handler"
This reverts commit a30526c87e.

Change-Id: Idcbf2a6c4e228a5fb6a890e8cdd58b6137295666
Reviewed-on: https://gerrit.libreoffice.org/28596
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-01 12:37:55 +00:00
Ashod Nakashian
16605b9289 Revert "loolwsd: canceltiles re-designed using tilecache instead of queue"
This reverts commit 571ff06906.

Change-Id: Icf9caeafc640b815f64211f240cfdac8e91694a1
Reviewed-on: https://gerrit.libreoffice.org/28595
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-01 12:37:47 +00:00
Ashod Nakashian
77a693c353 Revert "loolwsd: remove tile queue and simplify tile response"
This reverts commit 59eaacd2f8.

Change-Id: Ieba9bbaaa6406e3e685b46ce12a44a0766127815
Reviewed-on: https://gerrit.libreoffice.org/28594
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-01 12:37:38 +00:00
Michael Meeks
1dce882fd1 Start of simpler input fuzzer. 2016-09-01 10:11:03 +01:00
Tor Lillqvist
c5d8e3c799 Clarify that LOOL_NO_LOGCOLOR has no effect if stderr goes to a tty 2016-09-01 10:34:34 +03:00
Ashod Nakashian
151d1ff955 loolwsd: unittest fixes
Change-Id: I7096b6dabfa59a536809c4e997168c8fce5791f0
Reviewed-on: https://gerrit.libreoffice.org/28578
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-01 04:09:23 +00:00
Ashod Nakashian
534ab15d2f loolwsd: more aggressive test for unresponsive clients
Change-Id: I9daf81661cf03be2ea38b5bc4d9688039912bd8a
Reviewed-on: https://gerrit.libreoffice.org/28577
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-01 04:07:53 +00:00
Ashod Nakashian
9b3343aad4 loolwsd: Don't block on client sockets and timeout in 1 second
Change-Id: I7fec1054cef25704f898a7a5211abfb398d61bee
Reviewed-on: https://gerrit.libreoffice.org/28576
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-01 04:00:17 +00:00
Ashod Nakashian
59eaacd2f8 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.

Change-Id: I9bb5856efed28caea9d4e6f94f77b093779e5241
Reviewed-on: https://gerrit.libreoffice.org/28575
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-01 03:59:31 +00:00
Ashod Nakashian
ce2309edd8 loolwsd: log errors while getting file info
Change-Id: I076da575f553f3199fa302f32e8c399b6339fe2c
Reviewed-on: https://gerrit.libreoffice.org/28574
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-01 03:57:36 +00:00
Ashod Nakashian
9308268144 loolwsd: tolerate missing WOPI username
Change-Id: Ied24b5562f63ecdd96ee6ac7fd312b3bb5599573
Reviewed-on: https://gerrit.libreoffice.org/28573
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-01 03:57:12 +00:00
Michael Meeks
f56d96229d Avoid profiling CL devices during jail setup. 2016-08-31 22:05:02 +01:00
Jan Holesovsky
2090f121b6 Don't check for nullptr after dereferencing.
StorageBase::create() is supposed to throw when there are trouble.
2016-08-31 18:36:42 +02:00
Tor Lillqvist
b7623d48d0 We should return true here
Fixes a regression introduced in
571ff06906, where every loleaflet client
ran into an error, displayed as "We are sorry, this is an unexpected
connection error. Please try again."

Found by git bisecting.
2016-08-31 17:54:24 +03:00
Tor Lillqvist
b57ddcd173 Sort #includes of C++ headers 2016-08-31 17:02:29 +03:00
Tor Lillqvist
a5e5d3cdf6 Introduce LOOL_NO_LOGCOLOR to enable turning off the annoying colours again 2016-08-31 16:59:43 +03:00
Tor Lillqvist
0f3a6a3fb0 LOOL_LOGCOLOR is no longer checked by loolwsd 2016-08-31 12:08:18 +03:00
Ashod Nakashian
571ff06906 loolwsd: canceltiles re-designed using tilecache instead of queue
Change-Id: I4b9ba91ee08bc9dd8d27df275e303f5517d9740c
Reviewed-on: https://gerrit.libreoffice.org/28526
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-08-31 04:44:56 +00:00
Ashod Nakashian
fad6715f7d loolwsd: guard against processing commands before fully loading
Change-Id: Iac915074728f616d81b05558b886998855326a2e
Reviewed-on: https://gerrit.libreoffice.org/28525
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-08-31 04:42:39 +00:00
Ashod Nakashian
a674fc7e8f loolwsd: logs and formatting
Change-Id: Ic3ec268cdc1962814654c7be676da62375494f66
Reviewed-on: https://gerrit.libreoffice.org/28524
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-08-31 04:41:31 +00:00
Ashod Nakashian
494feedd8d loolwsd: unittest cleanup
Change-Id: I60b8c783b16f37530d208f1fdad029d97996e4cc
Reviewed-on: https://gerrit.libreoffice.org/28523
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-08-31 04:40:25 +00:00
Ashod Nakashian
5158818d82 loolwsd: getDocSize -> parseDocSize
Change-Id: I82ee96d6fde8d8c379547d05d7bbb8213a474a4f
Reviewed-on: https://gerrit.libreoffice.org/28522
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-08-31 04:39:43 +00:00
Ashod Nakashian
88f3a213b0 loolwsd: first character of 404 messages are trimmed
For some reason Poco trims the first character
of 404 and other HTTP error messages.
We need to prefix messages with a space to
avoid having the first character chopped-off.

Change-Id: I8cbda9f4b5df894418f1dedf390b8b43a61e5d11
Reviewed-on: https://gerrit.libreoffice.org/28521
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-08-31 04:37:21 +00:00
Ashod Nakashian
492268913b loolwsd: grep-friendly logs
Log entries now prefix the log-level so
it is now trivial to filter-in or -out
a particular class of logs (for example
errors).

Change-Id: I8033d1780a49dd8a3244e63f867377f0c64e9d9f
Reviewed-on: https://gerrit.libreoffice.org/28520
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-08-31 04:36:56 +00:00
Ashod Nakashian
d8a38f5859 loolwsd: startup logs
Change-Id: I90e7debbe881eafc9d65f4ff6a5d5f39d8277c0e
Reviewed-on: https://gerrit.libreoffice.org/28519
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-08-31 04:36:25 +00:00
Ashod Nakashian
42624adf19 loolwsd: fixup unittests
Change-Id: Icf3dea11654cf43a8aa86fadc1f1276d796719c3
Reviewed-on: https://gerrit.libreoffice.org/28518
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-08-31 04:35:55 +00:00
Ashod Nakashian
38a84d2c90 loolwsd: log the tile version after rendering
Change-Id: Id0d532bbf2d836a31ba90f1a47664bd7261a1779
Reviewed-on: https://gerrit.libreoffice.org/28517
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-08-31 04:35:05 +00:00
Ashod Nakashian
1e2dd2d61f loolwsd: TileCacheTests cleanup
Change-Id: I6d09ed3216d4e3651f72c0387c8cc6f2a7d5cc90
Reviewed-on: https://gerrit.libreoffice.org/28516
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-08-31 04:34:24 +00:00
Ashod Nakashian
5ffcafa736 loolwsd: CPPUNIT_TEST_NAME can be regex
To run selective tests only, CPPUNIT_TEST_NAME
envar can be defined to hold the test-name,
for example TileCacheTests::testClientPartImpress.

Now it's possible to pass a regex value instead,
for example TileCacheTests::testC.* to run both
TileCacheTests::testClientPartImpress and
TileCacheTests::testClientPartCalc.

Change-Id: I96aa1ce242fd8afaf073527777be50308dce867c
Reviewed-on: https://gerrit.libreoffice.org/28515
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-08-31 04:33:45 +00:00
Henry Castro
cd40f694ab loolwsd: test: optimal column/row width/height 2016-08-30 17:47:59 -04:00
Pranav Kant
76884fc020 loolwsd: Remove unused method
Change-Id: I9fcd2610c9cd27a32a9a835801ef627a631a85da
Reviewed-on: https://gerrit.libreoffice.org/28485
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2016-08-30 07:46:18 +00:00
Pranav Kant
db5efae2b8 loolwsd: Handle user names with spaces; encode/decode properly
Change-Id: I209bbd63686db8112529a3442a13a6162ce14d60
Reviewed-on: https://gerrit.libreoffice.org/28484
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2016-08-30 07:46:09 +00:00
Pranav Kant
7d48cd6f17 loolwsd: Echo back view information to clients
View information as of now includes viewid and username
associated with the view.

Change-Id: If0c4957eb56962eb4b1b1d0c1189dc300fa6b857
Reviewed-on: https://gerrit.libreoffice.org/28482
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2016-08-30 07:45:47 +00:00
Pranav Kant
67444eeb80 loolwsd: Pass sessions' usernames to core
Change-Id: I8c81c02fafd2cb9d0048729401e082bb422e299b
Reviewed-on: https://gerrit.libreoffice.org/28481
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2016-08-30 07:45:37 +00:00
Miklos Vajna
e4bbc15132 Avoid inclusion of deprecated C++ headers
Change-Id: I29abf3feeb8419f4e15ccb8dc7c34c086696ce07
2016-08-30 09:06:47 +02:00
Tor Lillqvist
86afada76e Update bundled LibreOfficeKit include files from LO core master 2016-08-29 17:54:28 +03:00
Tor Lillqvist
7d4ab644f8 Add REDLINE_TABLE_ENTRY_MODIFIED 2016-08-29 17:22:35 +03:00
Tor Lillqvist
4409ccd222 Don't crash if there is no "rendering" in the options JSON of the load message 2016-08-29 17:22:35 +03:00
Tor Lillqvist
ccdac2f767 Adapt the GET after 8cc367638f
The thing to GET is now lool/ws/ + the actual document URL.
2016-08-29 17:22:35 +03:00
Pranav Kant
f8ebb54af0 loolwsd: Receive WOPI userid, username
Change-Id: I0bd5e5a155b8f8486fbeffb1c1413d5e9c177fc3
2016-08-29 19:39:50 +05:30
Pranav Kant
c67c85793b loolwsd: Inform opening view about existing views
Change-Id: I84de6f78ffa21f3018e987e9e0bfeafd0cfb2b52
2016-08-29 18:37:57 +05:30
Pranav Kant
f6217133f4 loolwsd: view ids - unsigned -> int
Change-Id: I4bc2aa109143dd4cfd88a49c1988b66ae134d647
2016-08-29 17:57:23 +05:30
Miklos Vajna
7e3225dceb LOOLKit: avoid unnecessary copy-initialization
Change-Id: I14a4bb7803676173ac164ff8bd7e9eeaa6031f75
2016-08-29 09:23:15 +02:00
Andras Timar
7535d95d44 loolwsd: fix xml tag mismatch 2016-08-29 09:02:56 +02:00
Pranav Kant
06b869bb63 loolwsd: -Werror,-Wpointer-bool-conversion
isSSLTermination() was added in b0619d387b

Change-Id: I63a702023b6a096154b510653bed885331e8e22d
2016-08-29 10:53:56 +05:30
Andras Timar
274d68644d loolwsd: handle HTTP HEAD request for / 2016-08-28 23:06:30 +02:00
Andras Timar
1403a7999a loolwsd: add loolstress to rpm 2016-08-28 23:06:30 +02:00
Andras Timar
05a7101789 loolwsd: add missing headers to dist 2016-08-28 23:06:30 +02:00
Andras Timar
b0619d387b loolwsd: add support of SSL termination 2016-08-28 23:06:30 +02:00
Ashod Nakashian
03921a0769 loolwsd: unittest cleanups
Change-Id: Ic383915012ac1c254960d976cc89d3f7c1a2cb02
Reviewed-on: https://gerrit.libreoffice.org/28440
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-08-28 18:50:11 +00:00
Henry Castro
fa2a99459f loolwsd: add fake .uno:DocumentRepair
Avoid double round trip requesting command value pair
.uno.Redo, .uno:Undo
2016-08-28 09:03:45 -04:00
Henry Castro
d36ff0afda loolwsd: avoid exception, commandName empty 2016-08-28 09:00:04 -04:00
Ashod Nakashian
960e0521bc Formatting
Change-Id: Iad77e0f69cdb186da35cf3b2d1c0e9020df31870
Reviewed-on: https://gerrit.libreoffice.org/28407
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-08-26 12:46:51 +00:00
Andras Timar
a5aa138774 loolwsd: response to HTTP GET / (e.g. for checking if server is alive) 2016-08-26 13:40:20 +02:00
Andras Timar
619ddb4c2f loolwsd: add favicon 2016-08-26 12:57:33 +02:00
Pranav Kant
178808f989 loolwsd: Notify other views when new view is added
... but no need to notify the one which is just added.

Earlier behavior was notifying only the one which is just added,
which is redundant as same is accomplished by 'status' message.

Change-Id: Ib09424d186c49527b7b9c36fdabf90c31518ee04
Reviewed-on: https://gerrit.libreoffice.org/28395
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-08-25 18:26:31 +00:00
Pranav Kant
ec6ddf91ba loolwsd: Send viewId to clients, not sessionId 2016-08-25 21:10:47 +05:30
Andras Timar
679ee2df27 loolwsd: set LOK_VIEW_CALLBACK by default 2016-08-24 14:19:34 +02:00
Tor Lillqvist
e10175aed6 Nah, it's better to use the Storage thing to get the user name
instead of accepting it in the load message

Let's not just bother documenting random examples of what might be in
the JSON, this is not the right place for it.
2016-08-24 10:32:00 +03:00