Commit graph

944 commits

Author SHA1 Message Date
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
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
Ashod Nakashian
73cdebc60c wsd: fixup alert all users unittest
Change-Id: I8d9c7581ed2ae42e180301c38a8775cb8dcb396a
Reviewed-on: https://gerrit.libreoffice.org/32716
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-04 04:33:17 +00:00
Ashod Nakashian
e665a20565 wsd: fixup max documents unittest
Change-Id: Ie61abcf5ce486463de3556522e2c726926ee4039
Reviewed-on: https://gerrit.libreoffice.org/32714
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-04 04:31:33 +00:00
Ashod Nakashian
606f85db87 wsd: fixup max connections unittest
Change-Id: I107dadb973554b21f20211c8316cec7139953f47
Reviewed-on: https://gerrit.libreoffice.org/32713
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-04 04:31:00 +00:00
Tor Lillqvist
f94d4c789d 'Handshake' is one word
Change-Id: Ibef905cc42a74052738a71bd4743431e30b863d1
2017-01-02 13:29:09 +02:00
Ashod Nakashian
6f6f308895 wsd: more robust canceltiles unittest
Change-Id: I0a71bbb84ff4ca3233d8a78a7c4b3718ec0ad382
Reviewed-on: https://gerrit.libreoffice.org/32634
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-02 06:19:44 +00:00
Ashod Nakashian
7dad1c5f6a wsd: more forgiving canceltiles unittests
canceltiles is not guaranteed to prevent
tiles from getting sent back to the client.

There is an obvious race between receiving
tile requets and cancelling them.

This reduces failures by repeating the
unittest when there is spurious failure.

Change-Id: Icf299e2212e175dc4c0cbc1d2f91c37725f2b261
Reviewed-on: https://gerrit.libreoffice.org/32631
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-02 06:17:21 +00:00
Ashod Nakashian
94b2262e27 wsd: don't test for pathological Poco behavior in our unittests
Change-Id: Ia7122eacce836aab5bef29c16529cbed16856be8
Reviewed-on: https://gerrit.libreoffice.org/32625
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-02 06:12:42 +00:00
Ashod Nakashian
8a20e3b265 wsd: load torture test made more stable
Change-Id: Icc1890480d7d5539dd3b855dfb775909d78a2e82
Reviewed-on: https://gerrit.libreoffice.org/32565
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-01 04:23:13 +00:00
Ashod Nakashian
e9f4e67efd wsd: more testLoadTorture flavors
Dedicated tests for each type of document.

Change-Id: I399e32a64ad0fe25f0cf4795cf428da922eea2f5
Reviewed-on: https://gerrit.libreoffice.org/32564
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-01 04:22:24 +00:00
Ashod Nakashian
2f81b37c07 wsd: load torture test
Load multiple views on multiple documents
concurrently and verify that the number
of views for each case is consistent and
as expected.

Change-Id: Ie550dd42880da7bdd0aef6d642e9b000be5c3f84
Reviewed-on: https://gerrit.libreoffice.org/32556
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-01 03:58:30 +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
0848882aa7 loplugin:rangedforcopy
Change-Id: Ied12a3d9016845035536b496d73e3fe7e77b4e33
Reviewed-on: https://gerrit.libreoffice.org/32364
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Tor Lillqvist <tml@collabora.com>
2016-12-27 10:21:30 +00:00
Noel Grandin
f56549753a loplugin:passstuffbyref
Change-Id: Ib9208e7585dbb8dfeab713daa173af190d9efebc
Reviewed-on: https://gerrit.libreoffice.org/32363
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Tor Lillqvist <tml@collabora.com>
2016-12-27 10:20:44 +00:00
Tor Lillqvist
023bde69dc Drop the .uno:MergeCells= thing from HTTPWSTest::testStateUnoCommand
It always failed. No idea why, or what this stuff is. See also
6bd899f3fa44f2d78092333a399e141889b43dca in cp-5.1 which might be
related, or not.

Change-Id: I95f964e3f99c681ec9eefd092e523babd919a5c0
2016-12-27 12:10:17 +02:00
Noel Grandin
02472514a3 loplugin:implicitboolconversion
the change in UnitPrefork.cpp looks like it might fix something
important

Change-Id: I95741c0256b22ac0bb4caadbd113b96584f784b5
Reviewed-on: https://gerrit.libreoffice.org/32343
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Tor Lillqvist <tml@collabora.com>
2016-12-22 14:54:56 +00:00
Noel Grandin
80b0eaa773 loplugin:unnecessaryoverride
Change-Id: Ib077de07e832ae30137f465596961731954d8e62
Reviewed-on: https://gerrit.libreoffice.org/32340
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Tor Lillqvist <tml@collabora.com>
2016-12-22 14:41:10 +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
839d7a9b43 wsd: deduplicate invalidate view cursor messages
Change-Id: I898c98ad42fb807ebeafafa47d85930025def57f
Reviewed-on: https://gerrit.libreoffice.org/32162
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-12-19 06:01:46 +00:00
Ashod Nakashian
2428a4e3a1 wsd: more Protocol unittests
Change-Id: I72742f767d9dcfcf1edbfaed4fada628ebef156f
Reviewed-on: https://gerrit.libreoffice.org/32159
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-12-19 05:57:03 +00:00
Ashod Nakashian
ea2c3eb15c wsd: deduplicate tile messages in SenderQueue
Change-Id: Ib1cc38f34534aa754503ef296871815bc3d5450d
Reviewed-on: https://gerrit.libreoffice.org/32158
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-12-19 05:55:33 +00:00
Ashod Nakashian
7e1529af31 loolwsd: add tokenization to MessagePayload
Change-Id: I39135b2ad65da5abce93848a68faffc93906a0c0
Reviewed-on: https://gerrit.libreoffice.org/32157
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-12-19 05:51:49 +00:00
Ashod Nakashian
32271b8d5c loolwsd: string trimming helpers
Change-Id: I5e47f92b624890421bd7022084063cdea77da12b
Reviewed-on: https://gerrit.libreoffice.org/32155
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-12-19 05:46:15 +00:00
Ashod Nakashian
8099b84c3e loolwsd: run whitebox unittests with make check
Change-Id: I4354e1f42f33a5b2181a895077e1e16abb4e2c99
Reviewed-on: https://gerrit.libreoffice.org/32154
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-12-19 05:44:40 +00:00
Pranav Kant
0e043853ea tdf#104695: Unit test for missing tiles due to low socket buffer size
Change-Id: I278c5d532cb9b6340dee71a4b66410b32a164704
Reviewed-on: https://gerrit.libreoffice.org/32072
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2016-12-16 10:25:15 +00:00
Pranav Kant
dd498ed079 Bin this unit test
This was added while debugging some problem with forward slashes
in docurl in websocket endpoint automatically being decoded on
some machines. But it turned out it was due to the apache server
setting. So, this test serves no purpose now and tests something
really obvious.

Change-Id: I4658354d53c481cf7554804383892f501bc408cd
2016-12-16 11:33:18 +05:30
Ashod Nakashian
fe38e0e1e6 loolwsd: per-socket dedicated sending thread
To avoid degrading performance for everyone
because of a single slow/bad connection, we
send data to clients each in its own thread.

Change-Id: I6f980c25a404c4d05bcdb1979849ea3d2776c7b9
Reviewed-on: https://gerrit.libreoffice.org/31984
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-12-14 04:21:20 +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
Ashod Nakashian
0b42af6d8d loolwsd: move SenderQueue to wsd
Change-Id: I33af4d1b2bbf0305cbc5fa6f05266d126f1bb803
Reviewed-on: https://gerrit.libreoffice.org/31884
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-12-12 05:20:43 +00:00
Ashod Nakashian
233cb94eff loolwsd: SenderQueue to hold messages to send to clients
This adds SenderQueue and a wrapper of messages to
send back to clients.

Currently no threading takes place, but the messages
are pumped through the queue nonetheless.

Change-Id: Id9997539c0a2a351cbf406f649c268dd3643e88e
Reviewed-on: https://gerrit.libreoffice.org/31883
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-12-12 05:19:04 +00:00
Michael Meeks
07d385630b Cleanup unit test output a little. 2016-12-08 17:47:21 +00:00
Michael Meeks
51949df882 Unit test to avoid assert returning. 2016-12-08 17:47:21 +00:00
Michael Meeks
7cf77c26f7 Improved fuzzer - to fuzz input.
Pass --unitlib=test/.libs/unit-fuzz.so to loolwsd to enable.
2016-12-08 14:53:01 +00:00
Tor Lillqvist
dc18ccfd56 The part number we get here seems to be always 1, not 0
No deeper understanding of what is going on... This is when running
against cp-5.1
2016-12-05 11:02:26 +02:00
Michael Meeks
a2ff6528bb UnitPrefork: bump timeouts. 2016-12-03 23:02:29 +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
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
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
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
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