Commit graph

445 commits

Author SHA1 Message Date
Pranav Kant
1d22f7bc54 kit: start spamming the logs when linking/copying is slowww
This is sometimes the case in docker when the link operation 'copies up'
things from lower layers to the working docker container's layer. In
such cases, let the admin know.

Change-Id: Ib72b67304a292c3832838379cc76bcb4a7268cb3
Reviewed-on: https://gerrit.libreoffice.org/48710
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2018-01-26 16:40:56 +01:00
Pranav Kant
c16d198560 Print humanized bytes in the logs
Change-Id: I2ebdea0c3a360be1573ae13fa9cbe6f432436f29
2018-01-26 20:03:22 +05:30
Henry Castro
90cd7791fa kit: remove unused debug code
Change-Id: Ibd69a2b451be0a075759524acff5f0e9fc820d05
2018-01-20 16:41:13 -04:00
Tor Lillqvist
eb2e62ebcd Fix misleading trace output: There is nothing called CallbackWorker::callback
Change-Id: I951d4a7706e0009b5a7266c86ea5b66a29242448
2018-01-17 12:35:38 +02:00
Miklos Vajna
d0d87401c1 kit: use NoFileSync flag for save
What LibreOffice sees as a save destination is just a temporary output
from the outside, so there is no point in doing fsync for that file.

This depends on core.git e90a16d71cdcfbd785401613a2e5a29cb1167acf (sfx2
store: handle NoFileSync for Save (not SaveAs), 2018-01-15).
2018-01-16 09:59:27 +01:00
Tor Lillqvist
457ec5b2b2 Use strdup() instead of fragile malloc+strncpy pairs...
...with manually counted string literal lengths even.

Change-Id: If11c65be25953b710a16d11e790d1b6d40119287
2018-01-10 16:09:41 +02:00
Tor Lillqvist
217636ed44 Drop meaningless "loolnb" word from a comment, drop two related #if 0 blocks
"loolnb" used to mean the concept of using non-blocking sockets back
when that was experimental proof-of-concept work in progress, but that
work has been merged in long ago and there is no neeed for the term
any longer.

Change-Id: I4c49b625fe8be8892b82115eaaa47bcba0f29500
Reviewed-on: https://gerrit.libreoffice.org/47699
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2018-01-10 13:01:26 +01:00
Ashod Nakashian
95af839fd9 wsd: trace first child's startup activity
To help debug early failure, log the first
child's statup at trace-level.

Change-Id: I8a6c8fe535bbc971174c0d950a2243460f81a2c7
Reviewed-on: https://gerrit.libreoffice.org/47628
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2018-01-09 13:06:48 +01:00
Ashod Nakashian
94781ec6d9 wsd: log at trace level until first child is forked
Change-Id: I1b995b4714738f3bffd6dac58cf90ee6f1a32898
Reviewed-on: https://gerrit.libreoffice.org/47565
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2018-01-08 05:52:39 +01:00
Jan Holesovsky
053aab99e8 Avoid an unnecessary buffer in the watermark code.
Change-Id: I29b162fd9d8f43d0a2cb75853f0a3c0dc8ee92df
Reviewed-on: https://gerrit.libreoffice.org/46527
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2018-01-05 15:26:42 +01:00
Ashod Nakashian
b0a7fadcc6 wsd: improve watermark visibility on dark and grey backgrounds
The watermark text is now rendered on a blurred version
of itself, using inverted colors. This makes it
look sharp on light backgrounds, but inverted in
a blurry haze when on dark backgrounds, thereby
being readable on top of any background.

Change-Id: Ia6daf987674c484980f1fdec4f74e579ed87c213
Reviewed-on: https://gerrit.libreoffice.org/46491
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/46526
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2018-01-05 15:26:42 +01:00
Jan Holesovsky
525284e32d lokdialog: Set the language of the given view.
Change-Id: I54d542ff736b37c9b08c3e73f65d3fc27d095acc
Reviewed-on: https://gerrit.libreoffice.org/46385
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2018-01-05 15:26:42 +01:00
Pranav Kant
f63858433b loplugin:includeform
Change-Id: Ib62a7aa61062f00698aa3e8a144438de5c57e53d
2017-12-20 21:21:05 +05:30
Marco Cecchetti
96a2d3c36c calc: LOK_FEATURE_RANGE_ADDRESS (solving compatibility issue)
In order to make cp-5.3 compatible with online 2.1.x we introduced a
new enum which by default disables collecting the new range based
header data implementation.

This patch (re-)enable this feature on online 3.x

Change-Id: Ieab4145df9d132810bd871b1a315fd2171ba0ab5
Reviewed-on: https://gerrit.libreoffice.org/46288
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
(cherry picked from commit 2a2c04651c3a935a793f7710118b5945f6966ab0)
Reviewed-on: https://gerrit.libreoffice.org/46598
Reviewed-by: Marco Cecchetti <mrcekets@gmail.com>
Tested-by: Marco Cecchetti <mrcekets@gmail.com>
2017-12-16 14:07:23 +01:00
Jan Holesovsky
2ef04a6446 lokdialog: Fix RGBA vs. BGRA confusion.
Change-Id: I42ce8f46ab09e9b6684ace0627323a013831c571
Reviewed-on: https://gerrit.libreoffice.org/46564
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2017-12-15 17:11:05 +01:00
Pranav Kant
155b3131fc Fix build; -Wunused-var
Change-Id: Iba03c7b64188c89d668aac07365fd8c706eeefdd
2017-12-05 09:38:04 +05:30
Michael Meeks
e11794da25 Disable delta generator for now.
Change-Id: I7aee52b5dc0dc0b09868170e50afc8ccb0e2f7b6
2017-12-04 22:01:16 +00:00
Pranav Kant
a5d4c3bb90 lokdialog: Set view id before posting to LOK dialog api
Change-Id: I53925a71718f1acfc2337f86f97f4f5526546383
2017-12-05 02:39:26 +05:30
Pranav Kant
53fc694a3c lokdialog: Use dialog close LOK API when user clicks 'X'
Change-Id: I3a90eb8b83688eed7db8228763633e31f82e58d1
2017-12-05 00:41:19 +05:30
Pranav Kant
849eb0d500 lokdialog: Adapt to LOK dialog API changes
Change-Id: I653304e71573eb253e09a72bc87d54b8554ba7ff
2017-12-04 22:13:50 +05:30
Marco Cecchetti
29a233e5a9 calc: set outline state
use a specific message from the client for set the visibility state of
a group instead of hijacking the update row/column header message

Change-Id: I69d66b30db0b4d8a0082cbd2524120491d4f97cb
Reviewed-on: https://gerrit.libreoffice.org/45446
Reviewed-by: Marco Cecchetti <mrcekets@gmail.com>
Tested-by: Marco Cecchetti <mrcekets@gmail.com>
2017-12-01 01:10:43 +01:00
Pranav Kant
a91f022e42 lokdialog: Remove getDialogInfo call; ncorrect dialog size handling
Change-Id: Ieff59baa984982bd8126102dafc5a97f673a4150
2017-11-29 13:35:12 +05:30
Pranav Kant
a19121bbbc Adapt to dialog API changes in LOK
... and bypass some unncessary DocumentBroker handling of dialog
messages.

Change-Id: I378dff7a9786479baaa43f5fde9d30f35bc7f948
2017-11-28 22:18:21 +05:30
Pranav Kant
5355c52e10 Allow sending binary websocket frames from IDocument interface
Change-Id: I89f304e69e0c7b5f87bd2883a775d5c256674ef0
2017-11-28 22:18:21 +05:30
Rene Engelhard
385008947d Revert "include <sys/sysmacros.h>"
This reverts commit af7685e499.
2017-11-28 01:10:18 +01:00
Rene Engelhard
af7685e499 include <sys/sysmacros.h>
kit/Kit.cpp:1688:13: warning: In the GNU C Library, "makedev" is defined
 by <sys/sysmacros.h>. For historical compatibility, it is
 currently defined by <sys/types.h> as well, but we plan to
 remove this soon. To use "makedev", include <sys/sysmacros.h>
 directly. If you did not intend to use a system-defined macro
 "makedev", you should undefine it after including <sys/types.h>.
2017-11-26 14:15:21 +01:00
Andras Timar
f3ab71e4b3 fix error: unused parameter ‘bufferHeight’ [-Werror=unused-parameter]
Change-Id: I6a1f64796d3304e12f0159bed03b5f95a760ce6a
2017-11-23 15:01:25 +01:00
Michael Meeks
74f44251b7 Deltas - collapse multiple rows to a single row.
Change-Id: Ia2a617c2adbbc4e66b7c773c2280ec609aead16e
2017-11-22 15:55:03 +00:00
Michael Meeks
5efb59db50 Make delta-builder row-based.
Change-Id: Ic59324535c4f412abc4e83774073eb8f57290704
2017-11-22 15:55:03 +00:00
Michael Meeks
42d264eeb0 Start of Delta unit-tests.
Change-Id: I1a25f5347c0d7430000146bb585a041d363bcf37
2017-11-22 15:55:03 +00:00
Michael Meeks
78398d4482 Move the Delta generator out into its own file.
Change-Id: I7f7553c292970b1a52879b6d6c14e67172022310
2017-11-22 15:55:03 +00:00
Michael Meeks
ed8807a1a5 Insert pixels from 'new' not 'old'.
Change-Id: I117348885073b740ed8b2df84d805854b2f00767
2017-11-22 15:55:03 +00:00
Michael Meeks
b1124c05a8 Deltas should be pixel based, add debugging.
Change-Id: I3b47b738ee71d015911e3d77b59b5f3cb34ecd75
2017-11-22 15:55:03 +00:00
Michael Meeks
0bfbbf9851 Start of delta creator.
Change-Id: Idf186cda4f11e2418d9ff9f435825832c6b10294
2017-11-22 15:55:03 +00:00
Jan Holesovsky
676b6ca610 Save As: If the LOK's saveAs failed, try under a different name.
This helps when the caller omitted the extension...

Change-Id: Ib7602ce8fa88bc867198dbba36b2582145bd0994
Reviewed-on: https://gerrit.libreoffice.org/44405
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2017-11-10 11:08:53 +01:00
Jan Holesovsky
b20faa8bdc Save As: Advertise the correct size when uploading the new file.
Change-Id: I9b20c4bdb7ddc848437edceae1a77ddb49d55133
Reviewed-on: https://gerrit.libreoffice.org/44357
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
2017-11-10 11:08:53 +01:00
Pranav Kant
a2a72572bb lokdialog: Paint only part of the dialog when specified
Change-Id: I5543c95a48fd0192e5c654598991125bcaeb62e4
Reviewed-on: https://gerrit.libreoffice.org/44519
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2017-11-09 04:25:13 +01:00
Pranav Kant
f1d78c7e62 lokdialog: send invalidate rectangle in dialog command
Change-Id: Iae00498a0ead1ee65dfce0332721e0d0fd2202fb
Reviewed-on: https://gerrit.libreoffice.org/44518
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2017-11-09 04:24:24 +01:00
Pranav Kant
6375789611 lokdialog: Support for dialog title
Change-Id: Ie66c74290eb0583882cb9395b01c00f91df50aa0
2017-10-28 08:15:16 -07:00
Jan Holesovsky
343c5bc690 tdf#99744 SaveAs: Extend test to check that the Save As result was sent.
Change-Id: I3788b87d2599c01000af97f496ee2b840c0cae3e
2017-10-26 11:11:38 +02:00
Jan Holesovsky
6745464c70 tdf#99744 SaveAs: Report back to loleaflet that the saveas succeeded.
Change-Id: I670c8b4503c1a4c0a88001a1343f6dec2974e044
2017-10-26 11:11:38 +02:00
Jan Holesovsky
7ff432a370 tdf#99744 SaveAs: Reimplementation of the PutRelativeFile going through Kit.
This is necessary so that changing of the file type works.

Includes a unit test.

Change-Id: Id01d44e555b6bac1002ff950de461fd330602f63
2017-10-26 11:11:38 +02:00
Tor Lillqvist
a806655e59 Fix makedev warning
g++ says: In the GNU C Library, "makedev" is defined by
<sys/sysmacros.h>. For historical compatibility, it is currently
defined by <sys/types.h> as well, but we plan to remove this soon. To
use "makedev", include <sys/sysmacros.h> directly. If you did not
intend to use a system-defined macro "makedev", you should undefine it
after including <sys/types.h>.

Change-Id: If5cd1ec0ca34b00b1248e9b2650d4d13e6d3bf64
2017-10-26 11:53:35 +03:00
Pranav Kant
e9e162b35e lokdialog: Mouse/key events, canvas use & child window impl.
Change-Id: If8ae5c284e7166d4a01bd664644134f11197f988
2017-10-25 00:39:03 -07:00
Pranav Kant
374d6a197d lokdialog: pass the dialog id in dialog command
Change-Id: Ia0e76b1dc93483340361777cf21f23127bac91e1
2017-10-25 00:38:08 -07:00
Pranav Kant
e74a4e2487 lokdialog: wrap the lok dialog image in dialog container
The two test dialogs, Spelling dialog and word count dialog
appear on the screen when invoked from the menubar.

Interaction with dialogs is WIP.
Mouse/key events and floating window still needs to be worked upon.

Change-Id: I2d439465c7536d0b453c8ade503ec181a96c90d2
2017-10-25 00:38:01 -07:00
Pranav Kant
de780f8253 lokdialog: wsd: first cut at lok dialog rendering api
Change-Id: Id522e0796428ed0a15ea3496e6726f51ed232e75
2017-10-25 00:37:41 -07:00
Pranav Kant
c52cc45f08 Catch unknown exceptions and log it
... before lokit thread magically dissappears because some function in
LO core threw an 'Exception'

Change-Id: I8357b18d95674af8ec4d2f57ad41087f7b7dfcff
2017-10-03 14:16:59 +05:30
Pranav Kant
55de8e6c1b lokdialog: Add dialog related callbacks
Change-Id: I5dc54c4bdbaf066b3b089a00fbc89b943e73caae
2017-10-02 15:40:23 +05:30
Marco Cecchetti
ee6e64528d wsd: support for FSIZE and NOFILE system limits
The routine for handling the configuration for the max file size
limit, was wrongly using NOFILE. Now we handle both limits correctly.

Change-Id: Ie8b63617286f66af6d4eb1b35b9e4f4b28f3c2a6
Reviewed-on: https://gerrit.libreoffice.org/42803
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/42811
Reviewed-by: Marco Cecchetti <mrcekets@gmail.com>
Tested-by: Marco Cecchetti <mrcekets@gmail.com>
2017-09-26 17:40:31 +02:00
Aron Budea
a71c13a718 Adapt to lok API CHANGE in core
Introduced in commit 5bcc79e825d542c40c9ee0f48d1d72ea9aa53c54.

Change-Id: I1f2bf27f45f7e62f96fc5059e02386b1c884b3e6
Reviewed-on: https://gerrit.libreoffice.org/42713
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2017-09-25 10:38:04 +02:00
Miklos Vajna
84e4ea2c3d Kit: pass by const reference and avoid redundant initializer
Change-Id: I550334ec9392121ff9084c35b5c8c6b410917080
2017-09-13 09:13:26 +02:00
Marco Cecchetti
dee39a562c support for rendering a watermark on each tile
Change-Id: I3edccac49a3bcd3d2493d8d7ef3a1ae29307e727
Reviewed-on: https://gerrit.libreoffice.org/41898
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2017-09-07 17:28:44 +02:00
Aditya Dewan
8ef4d33e15 Adding ruler to loleaflet
Change-Id: I585850a7111eb5ab70bc5b51a508eb29317b92ca
Reviewed-on: https://gerrit.libreoffice.org/40461
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2017-08-28 10:45:33 +02:00
Tamas Bunth
b285c5f321 Copy file with linkOrCopy
So that it can create folder in jails when needed.
2017-08-16 16:14:59 +02:00
Pranav Kant
ef54b6ea16 wsd: Ignore useractive, userinactive when doc is not loaded
Sometimes client sends a userinactive message while the document is
already being loaded, which leads to the kit process skipping sending
the result of LOK callbacks to the client.

Handling this in child session is futile in the case when userinactive
message is sent when the document is being loaded, since kit process
handles the 'userinactive' message only after document is loaded (i.e
isLoaded() returns true). Moving this handling to DocumentBroker will
take care of both the cases - when 'userinactive' is sent before load
starts, and during load of the document.

Change-Id: I4ea3ac7b184d2ca373eb3ff4fb7b4ae394d454df
2017-08-11 23:27:17 +05:30
Jan Holesovsky
894c5f2cc2 Warn more about missing capabilities, and advise what to do on SLES11.
Change-Id: I93587db6fa32c1c505877c20857799be71ee162f
2017-08-10 11:12:24 +02:00
Pranav Kant
a283942b00 Fix a superfluous condition
(a != 0 || a != 1) makes no sense. Author probably meant AND, not OR.

Change-Id: If91954e9e48e5804c54380db8c99184ef0fcc1d2
2017-07-20 21:08:19 +05:30
Aditya Dewan
3a43f69116 tdf#108341 automatic editor switch and follow added
Change-Id: I5129256a0633916a3ca2cb05ccba39a5f4a5d398
Reviewed-on: https://gerrit.libreoffice.org/39299
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2017-07-06 09:46:49 +02:00
Andras Timar
ad8bffa04a configure option to disable SECCOMP
Change-Id: I8120674b60d388a3f85190631469a112c4af9266
Reviewed-on: https://gerrit.libreoffice.org/39408
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2017-07-03 11:43:01 +02:00
Ashod Nakashian
98dd83338c wsd: log jail removal
Change-Id: I1fef24d66bcab800dc1b4536da781ab8d344586e
Reviewed-on: https://gerrit.libreoffice.org/39463
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-07-03 05:42:15 +02:00
Michael Meeks
294ff36ed2 Re-factor: pass oldWid into encodePNG sub buffer.
Change-Id: I37bce07d64240aba254a0c4cbcc1804f2dd98a13
2017-06-24 13:03:28 +01:00
Michael Meeks
3f59438f62 Simplify renderid generation, and re-order.
Change-Id: I3f934fdf16b1a9cf4ea00571616d9b5568535707
2017-06-22 18:41:16 +01:00
Michael Meeks
73a87493f0 Use WireIds instead of long hashes to identify tiles efficiently.
Changes protocol to use 'wid' instead of 'hash' everywhere. Wire-ids
are monotonically increasing integers that can be mapped to hash
values for all of the hash values and tiles we cache internally.

Change-Id: Ibcb25817bab0f453e93d52a6f99d3ff65059e47d
2017-06-20 21:49:44 +01:00
Ashod Nakashian
44d8876f27 Remove data rlimit
Seems to have no effect, so gone in
favor of RLIMIT_AS (virtual memeory).

Change-Id: I210879ec9285f420c9f9839cdabf45c42d865fb3
Reviewed-on: https://gerrit.libreoffice.org/38720
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-06-13 06:27:12 +02:00
Ashod Nakashian
36fb1e64f0 wsd: new internal command to change config values
Change-Id: I8b4a573ba7b01ee6e7b3b91a00e12cc744f85fa8
Reviewed-on: https://gerrit.libreoffice.org/38676
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-06-12 06:18:53 +02:00
Ashod Nakashian
6de3adcf9c wsd: pass default rlimits to forkit from config
Change-Id: I84d271f460f0fb1d03a973107c32265d84bf2841
Reviewed-on: https://gerrit.libreoffice.org/38675
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-06-12 06:18:31 +02:00
Ashod Nakashian
42969b732c wsd: log the relevant rlimits at Kit startup
Change-Id: I6ada56d9bda80301ab55de2c831452b21aa362c1
Reviewed-on: https://gerrit.libreoffice.org/38674
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-06-12 06:17:58 +02:00
Ashod Nakashian
a59f78b656 wsd: UserExtraInfo is a map, not array
Change-Id: I64ef04c96223ee74099697cb2276307d834db329
Reviewed-on: https://gerrit.libreoffice.org/38291
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-06-01 07:48:15 +02:00
Ashod Nakashian
8a2c60e5b6 wsd: avoid race during viewinfo notification
Change-Id: If2d8adc67337a5529cb6898808a84727ff1df38e
Reviewed-on: https://gerrit.libreoffice.org/38123
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-05-29 06:47:42 +02:00
Ashod Nakashian
da2d3cbc92 wsd: support per-user links and commands
userextrainfo is a json array that contains
extra user-specific links.

Currently 'avatar' is assumed to hold the
image url for the user's avatar.

'mail' and other links can also be added.

Change-Id: I37c4c68bfa0b7ee659e017b4867dcb8cf5c2ca2f
Reviewed-on: https://gerrit.libreoffice.org/38120
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-05-29 06:45:18 +02:00
Ashod Nakashian
873cbcbe91 wsd: logging corrections
Change-Id: I35c52494137ea174c218bf936bc2440634036e3e
Reviewed-on: https://gerrit.libreoffice.org/37889
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-05-22 07:03:47 +02:00
Marco Cecchetti
024e786e85 calc: added an address input field
Change-Id: Ic030724e392693847a195b5e53866b40ebad7435
Reviewed-on: https://gerrit.libreoffice.org/37359
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2017-05-11 17:55:23 +02:00
Ashod Nakashian
9798eafb8c wsd: random jail paths instead of pid
Jail paths are now generate from a PRNG
instead of using the PID of the kit process.

The PRN is converted to base-64 and used
as the directory name where a given
kit is jailed.

Change-Id: I8e4bc35d9ccdfdae0e542ab707c417cd29ad52f3
Reviewed-on: https://gerrit.libreoffice.org/37372
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-05-08 04:59:12 +02:00
Ashod Nakashian
f062b2058e wsd: use fast tokenizer
Change-Id: I477bac24a5e944ce3d747db6e694f2766b44c7f3
Reviewed-on: https://gerrit.libreoffice.org/37370
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-05-08 04:52:23 +02:00
Michael Meeks
7f4f752667 Initial seccomp work.
Add a list of unhelpful looking system calls to improve containment.

Change-Id: I2e4bf3e0a6a752d427299728663d17120586bb10
2017-04-28 14:26:21 +01:00
Jan Holesovsky
04bf59060d inactive: Record also the change tracking and comments.
Unfortunately we need to record the entire sequences of what was happening.

Change-Id: I6c52f187e881dd3eadaea6958c0d49ed8f6942cb
Reviewed-on: https://gerrit.libreoffice.org/36960
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2017-04-25 18:20:03 +02:00
Jan Holesovsky
c36e619d24 inactive: Invalidate tiles when we return back to the active state.
Change-Id: Ib97d6463c52ecf153d3c19ab7efc47d99b71ce9b
2017-04-24 19:24:28 +02:00
Jan Holesovsky
e78c862c47 inactive: Replay the state payload, not the only the value.
We need to replay 'client-0054 statechanged: .uno:StateWordCount=5 words, 30 characters',
not 'client-0054 statechanged: 5 words, 30 characters'.

Change-Id: Ifd1fc7d6d567bcf209dffdd826400f5a5248aa7e
2017-04-24 19:24:15 +02:00
Marco Cecchetti
1e0deae3df Calc: changed the way header are updated on row/col insertion/deletion
Now when a row/col is inserted/removed or resized is the core to
notify the client that current header is no more valid and a new
header should be requested by the client to core.

In this way core can notify the header invalidation to all views.

Change-Id: Ia3c1872b73cfb3458cd0d35907291a9fc9eebd11
Reviewed-on: https://gerrit.libreoffice.org/36729
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2017-04-21 15:45:15 +02:00
Michael Meeks
36900f7d78 Clear display to avoid potential problems.
Running --nocaps under massif; it is unexpected to see
fire_glxtest_process doing heavy lifting glx work.
2017-04-08 13:32:00 +01:00
Michael Meeks
9ea75f974c Re-allocate vector storage to compressed size. 2017-04-07 22:33:01 +01:00
Jan Holesovsky
1585cbdb6b Merge document size changes callbacks in the message queue.
Change-Id: I1a540b17f2a72c374568db834a30b814878e9032
2017-04-07 12:13:45 +02:00
Jan Holesovsky
69d3671e4e More logging of the rendering time.
Change-Id: Iecaab7150b0f9751c2d53813e29d5ca115115980
2017-04-07 11:30:12 +02:00
Ashod Nakashian
fa753e5e06 wsd: time lok_preinit and log when finished
Change-Id: I2ea3dc226c84870690bbf9b041263650c923d5bd
Reviewed-on: https://gerrit.libreoffice.org/36112
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-04-05 04:45:03 +00:00
Ashod Nakashian
95d51493aa wsd: remove nextmessage
This was a workaround to Poco's limitation
of requiring socket receiveFrame be given
preallocated buffer, which couldn't be
exceeded by a larger payload. This meant
the receiver had to know the maximum
payload in advance.

Since only the Kit uses Poco sockets,
and the Kit never receives large payloads,
this preamble is now obsolete.

100% (94/94) of old-style tests PASS.

Change-Id: I76776f89497409e5755e335a3e25553e91cf0876
Reviewed-on: https://gerrit.libreoffice.org/36037
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-04-03 05:18:09 +00:00
Ashod Nakashian
c9365ad679 wsd: log the DocBroker ID in the Kit as well
This matches the document between WSD and kit,
making logs much easier to read.

Change-Id: If55a9eb84b4a22d2dc4dd53f5f6ab322ebc3646e
Reviewed-on: https://gerrit.libreoffice.org/36028
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-04-03 05:11:23 +00:00
Pranav Kant
ce1084b74f wsd: Send readonly info to clients
With this every other client would be able to know about other client's
permission i.e whether they have opened the document as readonly. This
could be important eg: to hide the cursor overlay of readonly users in
the UI or to mark these users as readonly in the userlist.

Change-Id: I5dcb1b4e5a22c9b546d16b69b9216cc7653cff04
2017-03-31 12:20:09 +05:30
Michael Meeks
a2398fc367 Improve debugging information. 2017-03-30 21:59:05 +01:00
Samuel Mehrbrodt
fd5df2f1da Revert "Don't try to copy the file when it already exists"
This reverts commit 0b91533abb.

Change-Id: Ic672cca1ba26cd926923632d27ea8bb9a64495b5
Reviewed-on: https://gerrit.libreoffice.org/35758
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2017-03-27 13:06:09 +00:00
Samuel Mehrbrodt
0b91533abb Don't try to copy the file when it already exists
Without this, 'make run' fails for me

Change-Id: I7fd3c39a0443d9f5d70af2382e498cd5c10435d8
Reviewed-on: https://gerrit.libreoffice.org/35649
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2017-03-27 08:41:14 +00:00
Jan Holesovsky
9f17050a7d Pass the locale settings from loleaflet to wsd/kit.
Change-Id: Ie530db73cfbdb62787f16eae0f4b07fbf8b8acb4
2017-03-24 12:34:32 +01:00
Ashod Nakashian
2e2f62edde wsd: improved logging
Change-Id: I6c4a5bcd54c0748cc413afbfcfb34c365b347669
Reviewed-on: https://gerrit.libreoffice.org/35118
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-03-13 04:11:24 +00:00
Michael Meeks
1f5b7b6def Include config layer to override kit config simply.
The config is read once during the forkit startup. Add a read-only
user configuration layer, and also disable config writing: no
writable user config.
2017-03-11 21:47:05 +00:00
Ashod Nakashian
57e7d22e28 wsd: logging and formatting cleanup
Change-Id: I5bfbd517c37b6df864d181abe7c70857815b9ece
Reviewed-on: https://gerrit.libreoffice.org/35082
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-03-11 19:50:08 +00:00
Michael Meeks
0eaef6c896 config.h - get includes right: must always be the first include. 2017-03-10 10:47:43 +01:00
Jan Holesovsky
a1a46c240e nb: Use the non-blocking socket in the loolwsd.
This so far only builds, but I did not even try to run it yet.

Change-Id: Iceacb5fc5c8994726508e8ea00bd495d758391a8
2017-03-10 10:47:39 +01:00
Miklos Vajna
f296c0ffeb wsd: avoid redundant string initialization
Change-Id: I5ac26d56c3b73e380d26226e83020ace3f1b54f4
2017-02-14 09:33:23 +01:00
Miklos Vajna
5c464d36b6 kit: strcpy -> strncpy in DummyLibreOfficeKit
Change-Id: I2e142efb6138a7712d9ba3953de9faa9fc0ab03c
2017-02-13 09:56:27 +01:00
Ashod Nakashian
6cd1d511be wsd: avoid segfault when handling invalid paste command
The payload of paste can't have length 0.

Now we silently skip such cases, although perhaps we
should be more strict and disconnect the offending
client.

Change-Id: Iaa2e7373277f9e7d85209aec56a2f8ee0ef7e801
Reviewed-on: https://gerrit.libreoffice.org/34112
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-02-10 07:02:26 +00:00
Ashod Nakashian
3fb136170f wsd: extend timeout when nocaps is specified
Change-Id: Id10b38716cc184bf899120bbe18d9095fd2f48e5
Reviewed-on: https://gerrit.libreoffice.org/34053
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-02-09 04:36:17 +00:00
Ashod Nakashian
404111877a wsd: broadcast client messages from WSD not from the Kit
Change-Id: I9c179a2f41a0aaeef35b84208be8ab91af9ee53a
Reviewed-on: https://gerrit.libreoffice.org/34051
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-02-09 04:27:27 +00:00
Jan Holesovsky
963aeb5d1f Don't leak children that did not manage to send their PID to wsd. 2017-02-09 00:09:21 +01:00
Jan Holesovsky
ad20adce1a fuzzer: Don't handle signals when fuzzing.
Change-Id: I2febdf96bcbbd5c6edaf791d99a77674e6f0b0a9
2017-02-08 21:39:55 +01:00
Jan Holesovsky
cd90d8adfe fuzzer: Add --dummy-lok command line option that bypases LibreOffice.
When provided, the DummyLibreOfficeKit is used instead of the real one that
calls LibreOffice.

Change-Id: Ic170d7b4adb72ba17a2b066c509c2b1e657dbccf
2017-02-08 12:34:16 +01:00
Jan Holesovsky
5873d15c62 fuzzer: Use the dummy LOK implementation when fuzzing.
Now it is possible to use:

  ./loolwsd_fuzzer --config-file=loolwsd.xml --o:storage.filesystem[@allow]=true --o:logging.level=fatal --fuzz=/tmp/looltrace

Ie. no need to specify the LibreOffice install location.  Ideally worth
disabling the logging output too, to gain higher performance.

Change-Id: I4fa5f275cd4f4a52fe2cd07e658cea726f6f31c2
2017-02-08 11:54:50 +01:00
Jan Holesovsky
ee79577960 fuzzer: Add a dummy LibreOfficeKit implementation.
This just returns empty values (or does nothing), instead of calling the real
LibreOffice.

Change-Id: Ie6fe0b554056ba73067a76c22067f088e1346b59
2017-02-08 11:25:21 +01:00
Jan Holesovsky
04d7ed9d09 fuzzer: Make the shared loolwsd and loolforkit binary actually work.
Change-Id: If6ee9f22d93aa040f94df86b30fdc8a0a1ad68e2
2017-02-07 13:27:14 +01:00
Jan Holesovsky
0dac1c4321 fuzzer: Compile a separate binary that contains both loolwsd and loolforkit.
Change-Id: I158e4b19d0929de03f09645c106aebfdbc44ea74
2017-02-07 13:27:14 +01:00
Jan Holesovsky
02e118387a Avoid including LibreOfficeKit.h.
Change-Id: I112b79790839352ffd0d82394ffc7e2d8e8dcf44
2017-02-07 13:27:14 +01:00
Ashod Nakashian
5dad626b6d wsd: remove handling of depricated partpagerectangles command
Change-Id: I13285e83179ab7654b6fd21a6548730e74d67425
2017-02-05 21:59:22 -05:00
Ashod Nakashian
d7a9a76ddb wsd: report PSS of kit processes
Each Kit process now reports its own PSS,
which is much more accurate as they share
a significant ratio of their pages with
one another.

Admin tracks the PSS values of the Kits
and reports to the console.

Change-Id: Ifa66d17749c224f0dc211db80c44f7c913f2d6c4
Reviewed-on: https://gerrit.libreoffice.org/33864
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-02-03 07:12:31 +00:00
Ashod Nakashian
b9a7e1ef03 wsd: improved test and cosmetics
Change-Id: I25a0a27c12394f41af8e021b72627b1c0537a166
Reviewed-on: https://gerrit.libreoffice.org/33862
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-02-03 07:08:43 +00:00
Ashod Nakashian
8519586674 wsd: manually generate the viewinfo json string
Change-Id: Ia1c1d8752fe134a43be2859db0eb8e87fe5d83f6
Reviewed-on: https://gerrit.libreoffice.org/33684
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-30 08:08:41 +00:00
Ashod Nakashian
7f15ef7ba0 wsd: minimize locking when generating viewinfo
Change-Id: I48b9465a3813aeabb0229c46f210771b82b1f8d1
Reviewed-on: https://gerrit.libreoffice.org/33683
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-30 08:07:04 +00:00
Ashod Nakashian
f33f014f98 wsd: simplify tracking of user info
Change-Id: Iac860c5c1862fa3bbb1b6dd39e827712eb34ed9a
Reviewed-on: https://gerrit.libreoffice.org/33682
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-30 08:06:31 +00:00
Ashod Nakashian
93858c5b9e wsd: forkit removes jails after reaping dead children
Change-Id: Ia4b8dd85b41fa59ececbed85e35616fee6a02254
Reviewed-on: https://gerrit.libreoffice.org/33678
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-30 05:11:07 +00:00
Ashod Nakashian
1ba7c0209a wsd: cosmetics
Change-Id: I58a9e579e228d7b4a1e1b5686988aeff8da9922f
Reviewed-on: https://gerrit.libreoffice.org/33674
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-30 02:11:13 +00:00
Pranav Kant
440ca8e2f7 Initial support for comments lok api
Change-Id: I1fc48e245a47f7b8d4260009d8c377c30d0b8820
2017-01-27 23:36:24 +05:30
Jan Holesovsky
c44f7b8a76 Revert "loolwsd: improved MessageQueue"
Now we don't get a situation where there would be a tremendous amount of
invalidates & tile render requests piled in the queue, so we can do it
deterministic again.

The only thing that could potentially pile in the queue are the keypresses
events sent from the clients, but that is a different problem anyway.

This reverts commit c326228774.

Change-Id: I98e199eab0187bf5f47ce322ac1b1b2e3b976b85
2017-01-26 11:49:29 +01:00
Jan Holesovsky
68e597b512 Merge the LOK_CALLBACK_INVALIDATE_VIEW_CURSOR messages together.
And LOK_CALLBACK_CELL_VIEW_CURSOR too - though that ones are not that
expensive.

Change-Id: I5f116c66b1ce4426694d5d58851e104f9061bf53
2017-01-26 11:49:29 +01:00
Jan Holesovsky
e1b4088810 Make the broadcasting actually work.
Change-Id: I35ba20a45fdfe9fc0182c30648693d76a3e10f8a
2017-01-26 11:49:29 +01:00
Jan Holesovsky
1b9e34a3f9 Squash the invalidation messages coming from various view into one.
Change-Id: I65f7e4eb0b82a8c76eef372548ad3298ac70bdd7
2017-01-26 11:49:29 +01:00
Jan Holesovsky
b5128d061d Revert "wsd: batched user-input processing"
This reverts commit 27e1428088.
2017-01-26 11:49:22 +01:00
Jan Holesovsky
febbb570c6 Revert "wsd: cap batches by duration"
This reverts commit 0fe580d9ab.
2017-01-26 11:40:53 +01:00
Ashod Nakashian
0fe580d9ab wsd: cap batches by duration
Batched loKit calls are now capped by time
to limit the maximum latency.

Change-Id: Ife354228f9837dbc4c2e4f216e7f9d85487bac14
Reviewed-on: https://gerrit.libreoffice.org/33423
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-23 05:40:34 +00:00
Ashod Nakashian
27e1428088 wsd: batched user-input processing
User input is batched together to reduce
overheads. This initial implementation
will batch all input of the same type
together.

Change-Id: Ia0069de9cf5acecf637941543267f86518c04640
Reviewed-on: https://gerrit.libreoffice.org/33422
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-23 05:36:48 +00:00
Ashod Nakashian
7f8ffcfab5 wsd: check for malformed callback messages
Change-Id: I991480ea0f7d588c2e9a4e31eaada23fc1da1ffa
Reviewed-on: https://gerrit.libreoffice.org/33419
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-23 04:37:48 +00:00
Ashod Nakashian
25be7f0ab6 wsd: use own tokenizer
Change-Id: Ia6e58767e3a138d086d4e0ae287782d3ed558076
Reviewed-on: https://gerrit.libreoffice.org/33418
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-23 04:37:21 +00:00
Jan Holesovsky
1cf4334ec6 partpagerectangles is useless, and causes trouble for many documents.
When invoked too early after the document load, on slower servers it is
executed before the layout of the document is performed, leading to crashes.

It is useless for loleaflet, so let's disable it here, and remove it in
master for good.

Change-Id: Icf08d9df5efc8b0488c94048803e703b40f67e24
2017-01-17 19:18:54 +01:00
Ashod Nakashian
6246e74433 wsd: copy jail files when symlinking fails
Change-Id: I1f56d1489820a0689495e09151101d41a2322b82
Reviewed-on: https://gerrit.libreoffice.org/33143
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-16 06:27:45 +00:00
Ashod Nakashian
6b3d2bd7ce wsd: notify the user when document loading fails
Also do not segfault in the event.

Change-Id: I80c4c5c0d1d5f1a4cde9a6a3458f69a3df9dc647
Reviewed-on: https://gerrit.libreoffice.org/33140
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-16 06:26:04 +00:00
Ashod Nakashian
e0dcc7a972 wsd: retain the Core callback object
Since we have no control over when Core might
use the callback object, we should retain it
indefinetely. This is safer and has no impact.

Because Core uses a timer to flush callbacks,
it can issue the callbacks for a view after
it had been destroyed, thereby segfaulting.

Change-Id: I2ef87234d0b4dff83ded320b480abce53188fec4
Reviewed-on: https://gerrit.libreoffice.org/33116
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-16 01:44:39 +00:00
Ashod Nakashian
6bcd793a8b wsd: don't exit Kit process when new sessions exist
When a new session is created in Kit, it means
a new view is about to be created. However if
in the interim the last session closes and
view is destroyed, Kit should not exit.

Instead, we unload the document and
prepare to reload it again.

Change-Id: Idbc3a663b4d6921440736499f2d439fc2b7e33dc
Reviewed-on: https://gerrit.libreoffice.org/33115
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-16 01:43:20 +00:00
Ashod Nakashian
0e5a75c46b wsd: exit the kit only when no more sessions exist
Change-Id: I26cd8876fd564f537dac4fb1748aee5b4dbdff04
Reviewed-on: https://gerrit.libreoffice.org/33114
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-16 01:43:08 +00:00
Ashod Nakashian
dea8c03912 wsd: no need to have the lock when notifying
Change-Id: If19aac3d52b45b0b0efc143885b933669d8a1198
Reviewed-on: https://gerrit.libreoffice.org/33113
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-16 01:36:00 +00:00
Tor Lillqvist
3d18b6558d Revert "I assume these plus signs were accidental slips of the finger"
Thet are intentional.

This reverts commit c31425e4e2.
2017-01-13 17:47:49 +02:00
Tor Lillqvist
c31425e4e2 I assume these plus signs were accidental slips of the finger
Change-Id: Ic227f40d1ba71cef388719ef10dfcf4d9f172caf
2017-01-13 16:23:18 +02:00
Tor Lillqvist
11ae90cfcb No Hungarian notation please
Change-Id: Ia624de45a792db7e39f2245aaea7d940b30b0db2
2017-01-13 14:52:08 +02:00
Tor Lillqvist
bc19f90dd4 Don't send a tile that hasn't changed even if client asks for it
The server tells the client the hash of each tile it sends (calculated
from the contents of the tile, not its PNG encoding). When the client
asks for a tile to be refreshed, it tells the server what the hash of
the existing tile is. If the server notices that the tile contents
hasn't actually changed, it doesn't PNG encode it and doesn't send it
to the client.

The intent is that this will reduce load on the server and also avoid
unnecessary tile traffic.

Change-Id: Ia06ca68655ea984ed4319f24f4470afda322eccf
2017-01-11 23:25:21 +02:00
Tor Lillqvist
3f7cca78eb Indentation fixes
Change-Id: I72010aeff7fb65f9dc18613d0cfc53b5154e07c1
2017-01-11 13:44:57 +02:00
Ashod Nakashian
f242865c3d wsd: simplify kit forking
Change-Id: I49338fbd2ccf944493f94a8f2c98750711733f1a
Reviewed-on: https://gerrit.libreoffice.org/32865
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-09 06:21:25 +00:00
Ashod Nakashian
b2160ee3a7 wsd: improved logging
Change-Id: I9c10803f451b6226c6a15d89acd4758c04042f28
Reviewed-on: https://gerrit.libreoffice.org/32864
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-09 06:20:33 +00:00
Ashod Nakashian
dfcada64b8 wsd: tilecombine now includes the versions of the tiles
Previously tilecombine had its own version, which is
nonesensical, since it's not really a tile.

Now it passes the version to the tiles when
parsing and serializes version per-tile.

Change-Id: I5db8d94880431e3d2a40b6787c6fe51a05771305
Reviewed-on: https://gerrit.libreoffice.org/32633
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-09 06:09:05 +00:00
Henry Castro
4641c922ea kit: use a second stage init after fork call 2017-01-06 15:49:33 -04:00
Henry Castro
22b80e285b kit: remove unused typedef function pointer 2017-01-06 15:35:57 -04:00
Tor Lillqvist
3f948ab333 Bin duplicate #include
Change-Id: Ic1bf34549b2ee081534aef5f0a77a1bd6023e36e
2017-01-05 12:08:37 +02:00
Tor Lillqvist
674fbc3f42 This variable can be const
Change-Id: Ie8b271c2383c2742b83139a43c90ba9272373d2f
2017-01-04 13:57:39 +02:00
Tor Lillqvist
a36d4b0fc3 Reanme png namespace to Png for consistency
As far as I see, we tend to use the same namespace name as the
basename of the corresponding include file, and this stuff is defined
in a file called Png.hpp.

Change-Id: Id859e13e94568abd9f1d5b4ef3bfbbb0c156db11
2017-01-04 13:35:26 +02:00
Tomaž Vajngerl
5d22bd5c95 Update cursor positions on active user - record events per view
When the user becomes inactive, we have to record events, that are
important to restore the user's document viewport when he becomes
active again.
We currently don't discriminate view events so events with different
view ID are considered as the same event and thus get overwritten.
The effect of this is that only the last cursor or selection of a
different view (different user working on a document) is updated
when the user becomes active again.
With this we discriminate view events and record them per view ID.
When the user becomes active again, we replay them for all views.

Change-Id: I0c6b9209f4d592d88fb23227c4de41084b8cd736
2017-01-02 14:34:46 +01:00
Ashod Nakashian
f0524b3ac9 wsd: must have document lock when accessing LoKit instance
Change-Id: Ie26178448fb513ed08acc61ec34c1af97e76eda8
Reviewed-on: https://gerrit.libreoffice.org/32617
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-02 06:06:16 +00:00
Ashod Nakashian
7f08cf5387 wsd: cleanup TileQueue accessing in Kit
Change-Id: I50ff5bea0e0b193baef2abfaa1a866a7e20f9ab8
Reviewed-on: https://gerrit.libreoffice.org/32616
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-02 06:05:45 +00:00
Ashod Nakashian
1a6098b925 wsd: TileQueue should be fully threadsafe
There should be no need to take a lock to
access it. However there were cases where it
wasn't thread-safe. Now we can remove unncessary
locking before invoking it.

Change-Id: I90d2c6940610a59aa6c749491ea85fb80b0acbcd
Reviewed-on: https://gerrit.libreoffice.org/32615
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-02 06:04:18 +00:00
Ashod Nakashian
d907c6b554 wsd: exit Kit immediately after unloading last view
Also kill canDiscard and hasSessions, instead call
purgeSessions directly.

Change-Id: I437fd3620299bc7f694c6c8e9c55fb6dccbe34a0
Reviewed-on: https://gerrit.libreoffice.org/32609
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-02 06:00:48 +00:00
Ashod Nakashian
9de86cc0ae wsd: refactor render options handling
Change-Id: I378ed6b76c236d9878c721a579c2b2296ff8144a
Reviewed-on: https://gerrit.libreoffice.org/32608
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-02 05:59:48 +00:00
Ashod Nakashian
b4c4b29ecc wsd: remove unnecessary checks of _loKitDocument
Since load() returns _loKitDocument, there is no
point in checking it again.

Change-Id: Ice511ba3f42cf9411918397a73497d3a07bbdfe5
Reviewed-on: https://gerrit.libreoffice.org/32607
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-02 05:58:48 +00:00
Ashod Nakashian
02b69738ca wsd: always lock documentMutex around loKitDocument
The _documentMutex used to be a member of _loKitDocument,
so it couldn't be locked when _loKitDocument was null.

However this has long since changed and is independent.
So no good reason not to lock it at every access point
of _loKitDocument, which is simpler and safer.

Change-Id: I82bdff5f94b5eaf68365d8cdb3ef5779e6c6cc87
Reviewed-on: https://gerrit.libreoffice.org/32606
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-02 05:58:26 +00:00
Ashod Nakashian
2fcf6220f1 wsd: log documentLoad call and duration
Change-Id: Ia1633ee6d57de5c13926a808f9adc2a85a9c839c
Reviewed-on: https://gerrit.libreoffice.org/32603
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-02 05:57:38 +00:00
Ashod Nakashian
ad2a9b90e4 wsd: lock when accessing session container
Change-Id: I3216036ee7ad4cf86b27dea35de97dae1baf67c7
Reviewed-on: https://gerrit.libreoffice.org/32605
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-02 05:57:21 +00:00
Ashod Nakashian
a1dd40eaad wsd: cleanup renderopts json creation and merging
Change-Id: I84e49938cc390cc9e6421e79903c7a8935f9775e
Reviewed-on: https://gerrit.libreoffice.org/32604
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-02 05:56:48 +00:00
Ashod Nakashian
c4d368149e wsd: simplify session purging
Change-Id: Ied5206dc524c8ff772c175ec4c78c23b9a305a32
Reviewed-on: https://gerrit.libreoffice.org/32602
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-02 05:55:43 +00:00
Ashod Nakashian
9d49e1595d wsd: check session before releasing lock
By the time load() is invoked, _mutex is already
unlocked in onLoad(), so it is no longer safe
to access _sessions.

So we need to get the session and pass it to load.

Change-Id: I671647f6df4128b8595082af2355fbef33994cdd
Reviewed-on: https://gerrit.libreoffice.org/32601
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-02 05:55:01 +00:00
Ashod Nakashian
a5440a4ab2 wsd: kit logging improvements
Change-Id: I12e0b82a45193f7a3633175667e842627be52ba5
Reviewed-on: https://gerrit.libreoffice.org/32563
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-01 04:21:32 +00:00
Ashod Nakashian
de4a7a139e wsd: Kit comments and cosmetics
Change-Id: Ie6abd479cfce77b41597dd793687e3f862d3dbba
Reviewed-on: https://gerrit.libreoffice.org/32559
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-01 04:18:51 +00:00
Ashod Nakashian
94ed8393c5 wsd: improved document/view loading logs in Kit
Change-Id: I51a86b73463dbbaa1875dde14be3745f69e097ef
Reviewed-on: https://gerrit.libreoffice.org/32555
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-01 03:58:06 +00:00
Ashod Nakashian
3a5be2926b wsd: log WS incoming messages only once
Change-Id: Iee31bc649ae2d194b6418367f0e9ab8561099b17
Reviewed-on: https://gerrit.libreoffice.org/32551
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-01 03:55:19 +00:00
Ashod Nakashian
ba9ffb4775 wsd: include cleanup
Change-Id: Id481cfbab6be12a095918bdc7318fb3584345307
Reviewed-on: https://gerrit.libreoffice.org/32548
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-12-31 23:22:15 +00:00
Noel Grandin
d6b767b840 loplugin:cstylecast
Change-Id: I5a0524aca89b16ba336d69028faf76cccab22d59
Reviewed-on: https://gerrit.libreoffice.org/32371
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Tor Lillqvist <tml@collabora.com>
2016-12-27 10:46:57 +00:00
Noel Grandin
05f88bf9a5 loplugin:redundantcast
Change-Id: I14945f34d3ab6d3c148b40e95069159bf40bd99e
Reviewed-on: https://gerrit.libreoffice.org/32370
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Tor Lillqvist <tml@collabora.com>
2016-12-27 10:45:42 +00:00
Noel Grandin
f53669cf9d loplugin:unreffun
Change-Id: I06b13a5c035f6ae4dd4b414f49a0987c019feea5
Reviewed-on: https://gerrit.libreoffice.org/32365
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Tor Lillqvist <tml@collabora.com>
2016-12-27 10:26:23 +00:00
Noel Grandin
4ed820d3d5 add a configure option for using clang compiler plugins
and apply the nullptr plugin.

Lots of hacking in my LO tree required to make this work, will probably
end up needing to add an extra parameter to the LO side.

Change-Id: I02ae1dcdece9d9ddf05f7757f6696e3a5d7d1f14
Reviewed-on: https://gerrit.libreoffice.org/32339
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Tor Lillqvist <tml@collabora.com>
2016-12-22 14:23:42 +00:00
Noel Grandin
4199efc91c convert enums to scoped
Change-Id: Ic3d4c09dbcec28b4638bb8888f812f970f40a1c5
Reviewed-on: https://gerrit.libreoffice.org/32331
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Tor Lillqvist <tml@collabora.com>
2016-12-22 09:51:56 +00:00
Ashod Nakashian
1376856107 wsd: logging updates
Change-Id: Icbee0349a3cfda5a56f8d681c779484e18b98ab6
Reviewed-on: https://gerrit.libreoffice.org/32287
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-12-21 15:01:20 +00:00
Henry Castro
f0c5e907ab kit: debug, simulate loading document
Very useful when the bug is reproducible in the preinit, init lokit stages,
so the scenario can be isolated.
2016-12-17 08:32:49 -04:00
Henry Castro
38549b0c9b kit: debug, wait until unique kit die
Very useful to debug preinit stage when it is
ensured 1 kit process
2016-12-17 07:56:03 -04:00
Henry Castro
20f6d8cdc7 kit: cosmetic
Required to custom lokit process debug
2016-12-16 23:39:53 -04:00
Henry Castro
e71c0046e7 kit: save first lokit PID
This is required to debug preinit stage
2016-12-16 23:39:08 -04:00
Ashod Nakashian
477ca6f414 loolwsd: cleanup the Sessions
Change-Id: I3cd065ab84e17f943fa7de7e094db574ff6fde07
Reviewed-on: https://gerrit.libreoffice.org/31931
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-12-13 04:35:00 +00:00
Ashod Nakashian
e60bc28a00 loolwsd: LOOLSession -> Session
Change-Id: I94369480fb0a6789375dfe5610ada300e94b80eb
Reviewed-on: https://gerrit.libreoffice.org/31930
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-12-13 04:34:19 +00:00
Miklos Vajna
645049e081 Kit: clean up redundant member initializers
Change-Id: I3a320d9647ab729e71ce93ce90fb63eb3b39ae35
2016-12-06 14:05:49 +01:00
Ashod Nakashian
c7e5874eff loolwsd: invalidate all parts when document size changes
This is a stop-gap until Core sends these invalidations
with more precision. Otherwise, we may be wasting valuable
cache data here.

This fixes showing incorrect tiles when slides are
inserted/removed from a doc.

Change-Id: I7a02c6fb96ff27223afe71d891db639ab5b2cfae
Reviewed-on: https://gerrit.libreoffice.org/31616
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-12-05 04:50:35 +00: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
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
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
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
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
Henry Castro
ddd91b4251 kit: enable notify undo/redo commands 2016-11-27 23:39:37 -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
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