Commit graph

4295 commits

Author SHA1 Message Date
Jan Holesovsky
e277935b1e Revert "loolwsd: alertAllUsersInternal expects lock to be taken"
Unfortunately this brings back the deadlock that
51c88c5fb7 fixed :-(

This reverts commit da3b1b208a.

Change-Id: If48c0b3ddebf3fb366786d90cb35c3c22963b1a1
2016-12-01 12:35:14 +01:00
Jan Holesovsky
2b13cfa1a7 Don't send setpart: to text documents, it will always jump to the 1st page.
Change-Id: I809f2ba493329174a33f99d63eec2c60b38acb05
2016-12-01 12:28:03 +01:00
Pranav Kant
15781a4655 loleaflet: Don't handle pageup/dn separately on 'keyup'
... as we handle it already during 'keydown' by sending keyboard
event to core which changes the slide for us.

Change-Id: Id61584ffa0ec5ff3aca098e3dcade664c306c6c3
Reviewed-on: https://gerrit.libreoffice.org/31475
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2016-12-01 11:17:37 +00:00
Pranav Kant
2c7f7e8b69 tdf#98484: Fix double-space in chrome when IME enabled
We regressed on chrome with
47699cd908 as 'textInput' event
clubbed with 'keypress' event started emitting double-spaces.

Tweak the hack to keep IME working on chrome while not regressing
when it is not enabled.

Change-Id: I0901724bf2db1794078fef3eb7283663b6f6a13b
Reviewed-on: https://gerrit.libreoffice.org/31469
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
2016-12-01 10:45:24 +00:00
Pranav Kant
a0be903cd7 Document wopi: protocol message
Change-Id: I3a082a264a6081e8225a7820ec78d85f27aea404
Reviewed-on: https://gerrit.libreoffice.org/31380
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2016-12-01 10:26:46 +00:00
Ashod Nakashian
da3b1b208a loolwsd: alertAllUsersInternal expects lock to be taken
Change-Id: I50a4d0edd500043c52c28aba3e61ba2a892c102d
Reviewed-on: https://gerrit.libreoffice.org/31459
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-12-01 06:00:01 +00:00
Ashod Nakashian
c326228774 loolwsd: improved MessageQueue
Tiles no longer hog the queue ahead of all else.

We now give priority to callback events, so clients
get to know the document state sooner.

Since tiles take long to render, an equal time
is given to non-tiles (capped at 100ms).

Finally, Impress preview tiles are given
the lowest priority and rendered only when
the queue is drained.

Change-Id: I922c1e11200e5675f50d86b83baee1588cbbf66f
Reviewed-on: https://gerrit.libreoffice.org/31394
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-30 04:42:40 +00:00
Ashod Nakashian
283cf812de loolwsd: Writer doesn't have parts
Fixup the part for EMPTY invalidation as well.

N.B. Should replace 'EMPTY' with '0,0,INT_MAX,INT_MAX'
to be consistent. Since both are expected, no compat
issues should be expected.

Change-Id: I066981622b1de71e9e849530df0583291b74b804
Reviewed-on: https://gerrit.libreoffice.org/31393
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-30 04:40:09 +00:00
Henry Castro
4366d6aad4 kit: render font failure if and only if fails encode PNG 2016-11-29 20:24:13 -04:00
Ashod Nakashian
95e682a647 Revert "loolwsd: combine tiles strictly in the same row only"
This reverts commit b8c9163ac8.

Change-Id: I8279473209a376c963dc750c0ca4f68d23050e81
Reviewed-on: https://gerrit.libreoffice.org/31338
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-29 02:45:45 +00:00
Ashod Nakashian
7a4250b90e loolwsd: terminate forkit when wsd dies
When we the pipe with wsd is closed we
assume wsd has died and we terminate too.

WSD can fork us anew, if it's still alive.

Change-Id: I669ed717db973b50498a6bc08e1fca59c6563443
Reviewed-on: https://gerrit.libreoffice.org/31337
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-29 02:42:46 +00:00
Ashod Nakashian
21b1287444 Revert "IoUtil: remove never read write of 'n'"
Setting 'n = -1;' helps to detect where the failure happened
when receiveFrame throws. At the bottom of the function we log
partially processed data by checking n (among others).

This reverts commit 752372a2b0.

Change-Id: I3294329c3d95b38d72c3fc824ab2eb7f2339adee
Reviewed-on: https://gerrit.libreoffice.org/31339
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-29 02:42:10 +00:00
Andras Timar
740a28bfae Bump version to 2.0.0+ 2016-11-28 19:13:59 +01:00
Jan Holesovsky
5e02a43306 The 'make run' should advertise a copy of the document, not the source.
Change-Id: Idddd804432ea1147ffbb43bffa0784d2759a9a36
2016-11-28 19:12:45 +01:00
Andras Timar
7a5fbd7f3c Bump version to 2.0.0 2016-11-28 19:10:27 +01:00
Jan Holesovsky
e15ec1d33b These constants are not needed any more.
Change-Id: I5e73d4eacdf5e88f11bc3755162fe601a65417fe
2016-11-28 11:33:20 +01:00
Jan Holesovsky
9842f3239f Make sure we don't use the jitter / delay in production builds.
And default to 0 even for debug; who wants to use that for debugging, they
know what to do.

Change-Id: I23dd0c5f806b2b31a883b7a2b8d822ea8c0bb6c5
2016-11-28 11:31:06 +01:00
Miklos Vajna
752372a2b0 IoUtil: remove never read write of 'n'
Change-Id: I2dfd85696b39ae1f1c7bbc33cec544bc04f980ac
2016-11-28 09:11:11 +01:00
Ashod Nakashian
b8c9163ac8 loolwsd: combine tiles strictly in the same row only
Change-Id: I1d2ba647deac8da749e7cf7b56a1c9a19fe840f8
Reviewed-on: https://gerrit.libreoffice.org/31299
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-28 05:27:55 +00:00
Ashod Nakashian
2b9ea3d4a6 loolwsd: notify clients before recycling wsd
Change-Id: Ib2733a6af1c27fe39c54f5c3bc6f5bd3acb72a2b
Reviewed-on: https://gerrit.libreoffice.org/31298
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-28 05:27:34 +00:00
Ashod Nakashian
c0f9ccee42 loleaflet: activate and dismiss dialogs only upon reconnection
Change-Id: I2d8b3d9788b7f66bc746537e34c90493a7cb408a
Reviewed-on: https://gerrit.libreoffice.org/31296
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-28 05:04:49 +00:00
Ashod Nakashian
68519f0927 loolwsd: destroy DocBrokers sooner
Change-Id: I10d8ea57083c3b785748062a927574a63e0dd250
Reviewed-on: https://gerrit.libreoffice.org/31297
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-28 05:04:35 +00:00
Ashod Nakashian
2239f25684 Renamed 'shutdown' to 'shuttingdown'
Change-Id: Idae53a59af13eb54b1f18f1a8cd1dde06421b426
Reviewed-on: https://gerrit.libreoffice.org/31295
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-28 05:03:54 +00:00
Ashod Nakashian
b35725ab70 loolwsd: support more efficient full-buffer hashing
Change-Id: Ie30929ad4665b51e280c1126adde645742814dad
Reviewed-on: https://gerrit.libreoffice.org/31294
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-28 05:03:17 +00:00
Ashod Nakashian
da30dc3df3 loolwsd: factor out the png cache lookup
Change-Id: Id287b136b687d9bc4f49a3583e18cb820f4eb21e
Reviewed-on: https://gerrit.libreoffice.org/31293
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-28 05:02:34 +00:00
Ashod Nakashian
47fa3b1b10 loolwsd: use a better hash function for png caching
We need a fast and good (high avalanche properties)
hash function for the png caching to avoid collissions
(even in the very limited samples we have, since tiles
are likely to have patters, such as all 0's and all 1's
etc.).

Bob Jenkins's public domain SpookyV2 is used here.
It has great avalanache properties and is fast at
~3-bytes / cycle for large messages.

Only trailing whitespace was removed from original
sources and 4 tabs converted to spaces.

Change-Id: Ife57237321625c836d85c894d939fd04a8f577bb
Reviewed-on: https://gerrit.libreoffice.org/31292
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-28 05:00:37 +00:00
Ashod Nakashian
ef9ab94580 loolwsd: less aggressive png cache eviction
The overall hit-rate improves significantly
when we don't remove entries too soon.
Here we give entries more time to show their
merrit.

There are now two limits, soft and hard.
The former is used to remove entries with no
hits at all, while the latter is used to
avoid overflowing the cache footprint too
much. Entries also get started with a single
hit, which prevents them getting evicted
too soon (i.e. right after getting added).

Finally, there is no longer need to reduce
the hit count of entries too agressively
since we have two tiers (soft and hard limits)
and zero-hit entries are removed before others.

The average cache size while auto-typing in
Writer doc is less than 180kb, which is 1.4x
the original size of 128kb.

Change-Id: I946318151638c9c64c714190084c492f9098852b
Reviewed-on: https://gerrit.libreoffice.org/31291
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-28 04:58:51 +00:00
Ashod Nakashian
9608935a7c loolwsd: png cache hit rate and cosmetics
Change-Id: I66ab1738503618002bb05504c608969d5aa7b9a9
Reviewed-on: https://gerrit.libreoffice.org/31290
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-28 04:57:45 +00:00
Ashod Nakashian
f4dd9c1e11 loolwsd: use vector instead of deque for MessageQueue
Change-Id: I879d248e54748916b30c64874ddc237fb662ac11
Reviewed-on: https://gerrit.libreoffice.org/31289
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-28 04:57:10 +00:00
Ashod Nakashian
db996c7e90 loolwsd: retry shutting down the WS upon exception
Change-Id: I3dc4b6f73c1ef5641c32e756099428a8ef38ee82
Reviewed-on: https://gerrit.libreoffice.org/31288
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-28 04:56:43 +00:00
Ashod Nakashian
b16fb68ec6 loolwsd: shrink SocketProcessor buffer when too large
When receiving large messages the dynamic socket buffer
is resized to accomodate the incoming large message.

This buffer was previously never reduced in size.
This is an obvious leak that is now avoided.

When the buffer grows beyond quadruple the default
size, it is shrunk back to the default. This gives
a decent balance between memory waste and unnecessary
resizing up and down after each large message received.

Change-Id: Ic3996c80e96592af6f12c4abd1dd737bdc07b814
Reviewed-on: https://gerrit.libreoffice.org/31287
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-28 04:56:11 +00:00
Ashod Nakashian
6ab32e0aa9 loolwsd: use larger threshold to large messages
Messages larger than a certain size are preambled
with a 'nextmessage' message that hold the size
of the subsequent message.

This is a workaround to a limitation the Poco
WebSocket API where if the buffer size is
smaller than the received frame the socket
ends up in a bad state and must be closed.
Unfortunately the new API that avoids this
workaround is not yet released by Poco.

Here we minimize the need for 'nextmessage'
to truely large messages. The limit is now
raised from above 1KB to over 63KB.

We may raise this limit further, but that will
cost each socket that much dedicated buffer size.

Change-Id: I01e4c68cdbe67e413c04a9725152224a87ab8267
Reviewed-on: https://gerrit.libreoffice.org/31286
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-28 04:54:37 +00:00
Ashod Nakashian
a8f3263132 loolwsd: use more efficient matchPrefix
Change-Id: I6f34b314295335270ff4da2827517d818c6a62ab
Reviewed-on: https://gerrit.libreoffice.org/31285
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-28 04:53:04 +00:00
Ashod Nakashian
86b38a29de loolwsd: fast in-place getTokenStringFromMessage
Change-Id: I5a7a7402c9394ac72aca907fc8b1072f6d2df5ad
Reviewed-on: https://gerrit.libreoffice.org/31284
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-28 04:50:57 +00:00
Ashod Nakashian
456c666cc9 .gitignore editor dot files
Change-Id: If48670b2fb0c5c9eb71dedccfc7e1b46706c109c
Reviewed-on: https://gerrit.libreoffice.org/31283
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-28 04:50:32 +00:00
Henry Castro
02095a3387 loleaflet: notify repair document when exists a conflict of multiple ..
.. users undo/redo
2016-11-27 23:39:58 -04:00
Henry Castro
ddd91b4251 kit: enable notify undo/redo commands 2016-11-27 23:39:37 -04:00
Henry Castro
2c2d460172 loleaflet: forgot remove console.log
only debugging purpose
2016-11-27 23:06:58 -04:00
Henry Castro
6947e914e1 loleaflet: re-work special character dialog to render all glyphs
.. on server side
2016-11-27 22:47:36 -04:00
Henry Castro
7234db9317 wsd: fix sending wrong UTF-8 string to the client
Client side console error "ws stopped cannot read
utf8 string", the cause it is sending special character '{',
'}',
2016-11-27 22:45:14 -04:00
Henry Castro
7760d6d6d5 wsd: fix URL encoded char parameter 2016-11-27 22:24:45 -04:00
Michael Meeks
85583f0a89 Avoid PNG compression for un-changed tiles. 2016-11-25 15:48:56 +00:00
Andras Timar
0f2e5ef3fe loolwsd: add common/FileUtil.hpp to tarball 2016-11-25 12:58:13 +01:00
Andras Timar
3e98b1d139 loolwsd: add common/SigUtil.hpp to tarball 2016-11-25 12:56:04 +01:00
Pranav Kant
d0929fb2f6 loleaflet: Popup keyboard on mobile devices
Change-Id: I4f0d1928633f5f0be4148fffd2c68c7aad1a0508
2016-11-25 16:57:06 +05:30
Andras Timar
3402546fae adapt maketarballfordeb.sh script to new dir layout 2016-11-25 12:21:30 +01:00
Michael Meeks
bbe0723e78 Tweak code to use new paths. 2016-11-25 09:59:03 +00:00
Michael Meeks
c1a398977f Adapt makefiles, includes etc. to new locations. 2016-11-25 09:58:57 +00:00
Michael Meeks
cca657c8f2 Apply the pre-branch rename script to re-organize the source. 2016-11-25 09:58:48 +00:00
Michael Meeks
4432aba25b Revert "loolwsd: support reading long messages directly"
This reverts commit 84607b43a3.

LOOLWebSocket piece requires a much too recent Poco.
2016-11-25 09:48:59 +00:00