Commit graph

3899 commits

Author SHA1 Message Date
Tor Lillqvist
6081160bd4 Add LOOLProtocol::getToken*FromMessage()
Tokenizes a string and looks for the requested named parameter (in the
form name=value, like the other getToken* functions).

Also add a unit test for the getToken* functions.
2016-09-26 19:32:15 +03:00
Tor Lillqvist
e0c5f26015 bccu#2035: Work around crash by just exiting before it happens 2016-09-26 17:31:49 +03:00
Jan Holesovsky
fb0e041232 De-duplicate the tiles resulting from the tilecombine split.
Change-Id: I836915c06685f94b01a4d3af66092b9f45e82217
2016-09-26 10:55:14 +02:00
Jan Holesovsky
137e677eb0 Fix a typo that prevented tilecombines from being split.
Change-Id: Iceecfcff3b547485a94a0b9ac356d634505ccbb4
2016-09-26 10:55:14 +02:00
Andras Timar
89ee9fd94b loolwsd: poco 1.7.5 as dependency of binary packages 2016-09-26 10:18:34 +02:00
Jan Holesovsky
5320b94c60 Avoid starving when we are getting way too many priority tiles.
Change-Id: If06d6c2b99ca38894e74154aaffdc25a1c54d2b6
2016-09-26 10:14:09 +02:00
Miklos Vajna
92ff278997 Fix gcc-4.8 build 2016-09-26 10:09:44 +02:00
Tor Lillqvist
a4290ec4da Add FIXME comment 2016-09-26 10:19:46 +03:00
Miklos Vajna
3629113e59 httpwstest: add tolerance, so that testCursorPosition actually passes
I got:

httpwstest.cpp:2198:Assertion
Test name: HTTPWSTest::testCursorPosition
equality assertion failed
- Expected: 1418
- Actual  : 1425

If we want exact equality, then the underlying difference has to be
fixed first.

Change-Id: I82600fc738ca0923d81d1b59521e1a46167bb781
2016-09-26 09:13:02 +02:00
Miklos Vajna
025c212ab8 LOOLStress: fix -Werror,-Wunused-const-variable
Change-Id: I93e70ea9703f8fded99ea186d606773fc1693c96
2016-09-26 08:54:40 +02:00
Miklos Vajna
8ded538d40 Admin: fix uninitialized members
Change-Id: I8b88af167bf26e485e6d9600f88f015c65c1359b
2016-09-26 08:49:19 +02:00
Ashod Nakashian
5905c3b3f2 loolwsd: combine single rows only
Combining as much as possible is too aggressive and
seems to harm performance where large areas are
invalidated during editing (f.e. inserting text
at the begining of a paragraph).

With this patch we only combine a single row at a
time. This is reasonable since rows almost always are
invalidated when a line is edited. Larger blocks
are typically less important.

This is experimental and might get reverted if proves
to harm more than help.

Change-Id: I6e4420e07a031805c1e2729b3f32de580ae4806e
Reviewed-on: https://gerrit.libreoffice.org/29289
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-26 02:51:05 +00:00
Ashod Nakashian
5daf4ab341 loolwsd: don't process callbacks or queue messages if terminating
Change-Id: I1ff75d01a0f24ba3b9d7ca2003f1633d0aa494e0
Reviewed-on: https://gerrit.libreoffice.org/29288
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-26 02:50:51 +00:00
Ashod Nakashian
e9a7f8c6c6 loolwsd: split tilecombined in the TileQueue
Delaying the splitting maximizes the chances
that we will deduplicate and combine them
in the queue optimally.

Change-Id: Ib721fe7596de7ad5d34159949fe75f16e861eb24
Reviewed-on: https://gerrit.libreoffice.org/29287
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-26 02:50:17 +00:00
Ashod Nakashian
d9c90e30fd loolwsd: move the editing view to the front
Swapping the views makes the current front
go to some random location, which isn't fair.

Change-Id: I147aceb6bc5e5eb751a86d557d72ecdedb34af23
Reviewed-on: https://gerrit.libreoffice.org/29286
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-26 02:49:48 +00:00
Ashod Nakashian
552a8a6f9b loolwsd: removed BasicTileQueue which served no purpose
Change-Id: If0a768dcc71e6a9957f52abe1f44b242ab3c836f
Reviewed-on: https://gerrit.libreoffice.org/29285
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-26 02:49:36 +00:00
Jan Holesovsky
4e7ba53a2b Prioritize the views where the cursor moved the most recently.
Even the order of the views matters when the editing is happening.

Change-Id: Id0868a8198f9fa955512fccba57fa063eab46e8c
Reviewed-on: https://gerrit.libreoffice.org/29284
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-26 02:48:49 +00:00
Jan Holesovsky
c97ebfc585 Prioritize the tile requests when extracting from the TileQueue.
When putting tiles into the queue, do only the de-duplication,
reprioritization is better at the get() time - no need to keep shuffling
the priorities according to the cursor moves etc. all the time.

The tile combination then does the rest of the work for us :-)

Change-Id: I100c433dd3b24228d1ca8e4c89891635db1115c1
Reviewed-on: https://gerrit.libreoffice.org/29283
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-26 02:46:59 +00:00
Jan Holesovsky
61b0ad4933 Fix a race between the tile rendering and invalidation callbacks.
Instead of 2 queues and 2 threads, merge those to one - which gives a perfect
ordering of the invalidations and rendering.

Change-Id: I229dfc08b43e6ce7e4f08ea8059d3298d9bf8f8a
Reviewed-on: https://gerrit.libreoffice.org/29282
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-26 02:44:19 +00:00
Ashod Nakashian
f6a9de1b2d Revert "loolwsd: TileCache is told to save or not before...
This reverts commit 01718c5c68.

Change-Id: I6fa49f8d1f5c6ba7bdcd8cfa0866e0e15380607d
Reviewed-on: https://gerrit.libreoffice.org/29281
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-26 02:38:29 +00:00
Ashod Nakashian
9d883bfc71 Revert "bccu#2018 - Missing tiles when finished typing"
This reverts commit 342125b8ea.

Change-Id: I2f509f5044b7a432c978138e31edef679f2aca78
Reviewed-on: https://gerrit.libreoffice.org/29280
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-26 02:36:33 +00:00
Ashod Nakashian
720f1260a7 loolstress: more accurate stats and other improvements
Change-Id: Ib4960fa2770ba783eb969c5a356f0bfa01b96dc9
Reviewed-on: https://gerrit.libreoffice.org/29279
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-26 02:35:48 +00:00
Pranav Kant
5891371dca loleaflet: Show usercolor in userlist
Change-Id: I6be05f36ffc4c00aa986b3873fce1bc5acc6fbf0
2016-09-25 23:36:51 +05:30
Andras Timar
50bf2ce246 Fix a few lintian errors and warnings 2016-09-25 19:24:07 +02:00
Henry Castro
d96df0a015 loolwsd: test: cursor and view cursor positions 2016-09-25 12:49:52 -04:00
Henry Castro
23b2792053 loleaflet: improve cursor, hide view cursor if same position 2016-09-25 12:42:32 -04:00
Henry Castro
02793428c7 loolwsd: test: graphic invalidate tiles 2016-09-24 10:55:38 -04:00
Pranav Kant
e7c510a202 loleaflet: Store view id as int
Change-Id: I80a36311a66767d3caafb9bb94df6205309af02b
2016-09-23 17:07:41 +05:30
Pranav Kant
2579e1191c loolwsd: Prevent passing a nullptr to std::string()
Undefined behavior.

Change-Id: I2ddcb0a5cba1d593791ced62783d02e732162d17
2016-09-23 16:15:46 +05:30
László Németh
68d3693d97 loleaflet: extend tile debugging
- show invalidated rectangles with fading effect
- show last tilecombine message and cancelled tile count
- show received/requested tile updates
- fix popup handling
- custom popup style (transparent, big numbers)
- clean up
2016-09-23 12:25:00 +02:00
Miklos Vajna
0b488905f9 MessageQueue: it and payload are the same, keep only one of them
It confuses me that 'it' is a reference, while 'payload' is a value, so
even if payload is a const value that's never written, it's not OK to
change it to a reference, as the underlying memory is released by the
in-between erase() call.

Change-Id: I05ad0f64e3eeedf847b74a6fadff610fc7469aa1
2016-09-23 09:04:23 +02:00
Pranav Kant
b6448a8864 loleaflet: Move loading spinner to toolbar-down when doc loaded
Change-Id: If3ae7801b8438da490f1ceba2e61824518bdc94d
2016-09-23 11:40:58 +05:30
Pranav Kant
c23b37f352 loleaflet: Better to have 'reconnected' signal here
Change-Id: I50c9484bb591d7192977fe49adb75f99d8ee1b08
2016-09-23 11:40:58 +05:30
Ashod Nakashian
342125b8ea bccu#2018 - Missing tiles when finished typing
aka: don't save invalidated tiles into cache

Tiles that are rendered when invalidation is recieved are outdated.

What we do is remember the last tile version when we get an invalidation.
This tile version, and any preceding it, is out of date and should not
get saved in the tile cache.

This fixes a race between rendering and invalidation, which happens
in the following scenario.

1. Tile requested for rendering.
2. User inputs key.
3. While tile is rendering, the tile is invalidated in Core
   (the shared lock between rendering and processing input doesn't
   include parsing tile request or preparing the payload back).
4. Once the tile rendering is done, but before it's encoded and sent back,
   the invalidation is received on the callback.
5. Tile cache is cleared of that tile.
6. The outdated tile is received on its way to the client, saved in cache.
7. Client requests the tile anew upon getting the invalidation.
8. The tile is served from the cache, which is outdated, therefore
   missing the last key input form the user.

The fix is in #3 to remember the version number of the tile being
rendered. Then in #6 we forward the tile to the client, but we
do not store it in cache. In #8 the tile request results in a new
rendering, since the cache will not have the tile. Only this last
rendering of the tile is saved in cache for future requests.

Change-Id: I0b0a3c2b917906c0d0c9046e3e6d3d4d354a7777
Reviewed-on: https://gerrit.libreoffice.org/29209
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-23 02:25:10 +00:00
Ashod Nakashian
1f207290f0 loolwsd: don't assert if we can't find subscribers to forget
Change-Id: Ic860eb58f17d1d7c8341881be2991d0bd8712a14
Reviewed-on: https://gerrit.libreoffice.org/29208
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-23 02:14:10 +00:00
Ashod Nakashian
01718c5c68 loolwsd: TileCache is told to save or not before notifying subscribers
Change-Id: Ibe24bbe9b4bf6fbaae7c9fcea5f919f7091d299e
Reviewed-on: https://gerrit.libreoffice.org/29207
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-23 02:13:48 +00:00
Pranav Kant
56d92527c2 loleaflet: Kill this troublesome editlock related code
This code throws sometimes. Rather than investigating what makes
it actually throw, lets kill it because we don't want any
editlock functionality anyways now.

Change-Id: I8a484ba9e3a658ca739122bb6d2d0c92c4180ff5
2016-09-23 01:43:40 +05:30
Pranav Kant
afe14df047 loleaflet: Start spinner when added to map
... otherwise we see a non-rotating spinner after first
initialization.

Change-Id: Idf6e259634607249e3411bf772a55fee768f925a
2016-09-23 01:43:26 +05:30
Pranav Kant
460ca57dab loleaflet: Smooth reconnection of documents
Change-Id: Id8e2b02ee47e163f046c81949d3d2ce75f330542
2016-09-23 01:43:26 +05:30
Pranav Kant
143ce92995 loleaflet: Don't send 'status' command, server sends it always
Change-Id: Ibcacda08309e887cb80588220fb423726134d959
2016-09-23 01:43:26 +05:30
Pranav Kant
7db798992f loleaflet: Set permission to default after reconnecting
Change-Id: I39ce187e47371785bf4a183253349bbdbea9786c
2016-09-23 01:43:26 +05:30
Pranav Kant
7c5a540e8d Add log files to .gitignore
Change-Id: I3f1cd2c3e770d8828de1ec09aaaf1329a4ce0123
2016-09-22 20:52:32 +05:30
Pranav Kant
2d73333984 loleaflet: 'tiledebuggingmode' is not a protocol message
Lets use this function, onMessage, for protocol messages only.

Change-Id: I418eab988ea54b814da3b05bf78b14f65709e586
2016-09-22 20:52:32 +05:30
Pranav Kant
4e6c1cf569 loleaflet: Group all other view's layers
Change-Id: Ide0d91850520e97550016b17c4505f2c75ead132
2016-09-22 20:52:32 +05:30
Pranav Kant
7ea0688760 loleaflet: Code reuse in debug mode implementation
Lets use the already existing getParameterByName function

Change-Id: Ib75ff5430e440cee609f48450a28916f9d2aff43
2016-09-22 20:52:32 +05:30
Miklos Vajna
9aeedd5268 leaflet: make sure showing the graphic view selection doesn't result in scrolling
Otherwise if you edit a different part of the document and somebody else
selects a shape, you get an unexpected, annoying jump.

Change-Id: I161a27c8a69e0873de0ebe3a020e2868cbe0afca
2016-09-22 16:56:39 +02:00
Tor Lillqvist
e7d587d694 Don't use << to write a non-nul-terminated naked char pointer 2016-09-22 14:35:16 +03:00
Miklos Vajna
2076bc54ff LOOLWSD: remove unused using decl
Change-Id: Ia3dbbb83a65485da67bede1e70a1fded2a1ade25
2016-09-22 09:12:26 +02:00
Tor Lillqvist
39f4e92b02 Log::end was missing in two places that used Log::debug()
It's too easy to forget the Log::end when using the Log::debug() etc
API. Not sure what could be done to that. Change the logging API to be
like LibreOffice's SAL_INFO?
2016-09-22 09:03:43 +03:00
Ashod Nakashian
a04f75d515 loolwsd: no need to return anything when subscribing to TileCache
Change-Id: I7b8280bf150a74db243c17cea11afc40899c4c0d
Reviewed-on: https://gerrit.libreoffice.org/29165
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-22 03:36:02 +00:00