Commit graph

5340 commits

Author SHA1 Message Date
Henry Castro
a759a01c7d loleaflet: ensure visible element before getting bounds
Change-Id: Iae66d8d52f4d97b61d861586e5a008c18d15e39d
2017-03-22 22:32:31 -04:00
Henry Castro
f3700400e6 loleaflet: fix the selection of the annotation object
Change-Id: I1bf6b669b768057b7b9943654db79b2966ca3ec3
2017-03-22 21:21:41 -04:00
Henry Castro
0107e0e0d9 loleaflet: handle annotation reply for writer documents
Change-Id: Iff95919d6f413b025ddb386150f458b9ecf2ce88
2017-03-22 21:11:53 -04:00
Henry Castro
e30bcdfcd8 loleaflet: add reply property to the annotation object
Change-Id: I58323dd35380e9cadf25661f85f38e080bbff026
2017-03-22 21:07:48 -04:00
Ashod Nakashian
0314f8751c wsd: fix saving of modified documents
Detection of modified documents used the
directory path rather than the document
path, which obviously wasn't correct.

Change-Id: I4a054a9ce2b64d70cd7a0a1c488dcc38ef46a581
Reviewed-on: https://gerrit.libreoffice.org/35526
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-03-22 02:59:30 +00:00
Michael Meeks
ce0dffdc12 Use callback API to implement alertAllUsers safely and simply. 2017-03-21 08:31:20 +00:00
Ashod Nakashian
dc90499514 wsd: remove the socket on move
Avoid explicit socket removal too.

Change-Id: I44d773761a5a463aad828c19c6b394bb6bac63d8
2017-03-20 23:26:06 -04:00
Ashod Nakashian
5eb6607f08 wsd: terminate the DocBroker when the kit disconnects
This can happen most notably when the kit crashes.
In this case the DocBroker is terminated so all
client connections are closed, allowing clients
to re-connect and re-open the doc.

Change-Id: I9854e11b002ca6e3c2a1a0bbb91ca087679d25bb
2017-03-20 23:26:06 -04:00
Ashod Nakashian
b01e555b47 wsd: correct copying of socket shutdown message
Avoid segfaulting.

Change-Id: I320606937a0d3a3e53270a70ef0a00fcb01b855a
2017-03-20 23:25:54 -04:00
Ashod Nakashian
4df1e3c8f2 wsd: timeout after last save before terminating DocBroker
Change-Id: I87430285be7350ffbd3dfd6516257ed2b4ce1869
2017-03-20 21:57:58 -04:00
Ashod Nakashian
58d3b7f9ff wsd: new test to validate recovery after kit crash
Change-Id: I406e5b72f6edf46dfde5da8c07daed21aef8b130
2017-03-20 21:33:59 -04:00
Ashod Nakashian
eab17f4496 wsd: assert response in test instead of failing with exception
Change-Id: I1090ee25ba87acbcbb1c66007fbf3363966952e4
2017-03-20 20:57:50 -04:00
Ashod Nakashian
c7b4d9ecab wsd: fix rendering options regression
The rendering options must be last in the load
command. This is because it could contain
characters that interfere with the parsing.

Change-Id: I14930d580d59014532d07410251acbd1316b4f61
2017-03-20 20:42:13 -04:00
Andras Timar
11fc3a0d02 package debian/ files and make them generic
Change-Id: Ia060b7d83c659db0354a5a1438b12bebaee45e03
2017-03-20 23:29:16 +01:00
Andras Timar
2828fc1684 no need for maketarballfordeb.sh any more
Change-Id: I18dd9e8fbd28431d49c67d40db521e0fdb6d3f27
2017-03-20 23:29:16 +01:00
Andras Timar
ef23ab447d don't hardcode lo_template_path, use the setting from loolwsd.xml
Change-Id: Ibb18d70ee24fd5ceefdd937a406c2f168997d1aa
2017-03-20 23:29:15 +01:00
Andras Timar
f97a59b559 RPM packager should define 'vendor'
Change-Id: I545251e9d2f18c90f5dc76b8c56b2c2cf338c81d
2017-03-20 23:29:15 +01:00
Andras Timar
29120b4454 Packager should know where LibreOffice is installed in target distro
Change-Id: Ie7e34be8eb34f60a41edbef22838828be0008e37
2017-03-20 23:29:15 +01:00
Andras Timar
b408d4b2d9 Use the name LibreOffice in loolwsd.spec file
Change-Id: I2fddb9c4baee08f461c328e35d95086825c691d0
2017-03-20 23:29:15 +01:00
Andras Timar
271a4cce2f add loolwsd.spec to dist tarball
Change-Id: I919c5a1a41a16dfd1806390865ed840a652cf9e2
2017-03-20 23:29:15 +01:00
Andras Timar
d6be72d73c For generality, introduce %{lo_rpm_list} macro
Give the list of libreoffice packages as requirement in rpmbuild command line.
rpmbuld --define 'lo_rpm_list <list of rpms>'

Change-Id: I2084df6078edd21872a7e303e5c717b5b0652902
2017-03-20 23:29:14 +01:00
Andras Timar
a3bb506c9d Poco was updated in SUSE repos
Change-Id: I6406adf979e82ab9d5a907ae31cadff458cc67f3
2017-03-20 23:29:14 +01:00
Andras Timar
2cf1f22439 Use LO_PATH instead of hardcoded path as config default
Change-Id: I0d6ce9e7938e2521e764978526fe2d9ce632c992
2017-03-20 23:29:14 +01:00
Pranav Kant
064b2508a7 loleaflet: Slide sorter for draw documents
Change-Id: I4ad11236c0186561b5c7df1a3c634e54f8576c8c
2017-03-20 13:59:52 +05:30
Miklos Vajna
98e2f0669a wsd: fix -Werror,-Winconsistent-missing-override
Change-Id: I25f644665951bbb7c188c0a73e929cb63eb1d580
2017-03-20 09:29:08 +01:00
Ashod Nakashian
d0bb5cbdc7 wsd: restore forkit after crash
Change-Id: Iacfcbfbf922897ea1bb9896d01a9a8afd4e194cc
2017-03-20 00:41:54 -04:00
Ashod Nakashian
53da72a1dc wsd: fix hot looping the poll
When not sending ping the ping time is not set
which results in the setting the poll timeout to
a negative value, forcing it to return immediately.

This happens when sending ping before upgrading
to WebSocket, which isn't common. One way to
reproduce it, however, is to connect to the
admin console with an unauthenticated socket.

Change-Id: I9f3db1a02b8f8e2781d23d843e848068ad434958
2017-03-20 00:41:54 -04:00
Ashod Nakashian
e9675ed6e1 wsd: close socket when WS close handshake is complete
We shouldn't send any more data after the client
shuts down, or after we initiate shutdown.

Change-Id: Ibf0cf61dcabe9d02ddcb7eb40b2df23712c5a136
2017-03-20 00:41:53 -04:00
Ashod Nakashian
5a3b812167 wsd: stop DocBroker poll and terminate child when no more sessions
Normally the last session either stopped and terminated
the DocBroker upon saving the doc, or immediately upon
removal when nothing to save.

However, saving could fail, or the session could be
disconnected by the client, or saving could timeout, etc.

In all those failure scenarios the DocBroker should
not linger as a zombie (alive but without sessions).
Here we detect that we are left with no sessions
and terminate correctly.

Change-Id: I31862234e321f63e686f54fa69daacc1fa06ae75
2017-03-20 00:41:53 -04:00
Ashod Nakashian
47bbbbb2dc wsd: correct prespawning of children and simplify
The prisoner poll should wake every so often
to check and rebalance the new children.

However this didn't happen correctly and
WSD would starve of children every so often.

The frequency of checking and rebalancing of
children should be reviewed and optimized.

Also simplified the code to avoid rebalancing
DocBrokers and only do NewChildren.

Change-Id: Id3be34ed3a47c739b606ee7969088397d3807e7a
2017-03-20 00:41:53 -04:00
Ashod Nakashian
6283dbd9cc wsd: copy and un-mask web-socket data at the same time
Change-Id: I2a4831065ae0a81f20d0513b0772d7d427ffc4ea
2017-03-20 00:41:53 -04:00
Ashod Nakashian
714eeac3aa wsd: simplify DocBroker creation
Change-Id: Icc93af2e32ce544c42cc65bbea83b9539c044db9
2017-03-20 00:41:53 -04:00
Ashod Nakashian
0d3ea2bbfd wsd: flag thread start before creating thread
This prevents a race where the thread is started
a second time before the first gets a chance to
set the flag.

Change-Id: Ib106aa0626cdfa403b321822180b0545d3aa9139
2017-03-20 00:41:53 -04:00
Ashod Nakashian
2ba2e213bb wsd: support rude termination of documents
Termination should normally be initiated by the
DocumentBroker in question, so sending of termination
message on the sockets come from the correct thread.

When termination happens from elsewhere
(f.e. cleanupDocBrokers) we cannot send socket
messages, and have to resort to rude termination.

Change-Id: I94acb7b314f5dbdc45c57049fc1ac8527ba72fb9
2017-03-20 00:41:53 -04:00
Ashod Nakashian
14779f5cd4 wsd: return moved socket state to stop any IO processing
Once a socket has changed ownership to a new
poll it will assert thread affinity with said
new poll. So we cannot do any IO on the old
poll's thread at that point and on.

Change-Id: I662f188dea7c377a18f3e546839ec43f2875dc7b
2017-03-20 00:41:53 -04:00
Ashod Nakashian
6e7bd4bcf0 wsd: cannot broadcast alert messages from random thread
Will have to come up with a different solution
to broadcasting alerts to all users.

Change-Id: I00260402f71c516f4335c592b10dee7555dc67a6
2017-03-20 00:41:53 -04:00
Ashod Nakashian
7096133f07 wsd: log thread affinity violations
Change-Id: Ib1317bc71f9162f005e0ce9b8c715bbce656db73
2017-03-20 00:41:53 -04:00
Ashod Nakashian
b1609a0087 wsd: cleanup session and docBroker after convert-to
Change-Id: I7d9c8eeef61c23cc3f4f902b15953abd5ec6851a
2017-03-20 00:41:53 -04:00
Henry Castro
7bf2637872 loleaflet: use textRange property to select the text
Change-Id: Ie396b199b33ab322a015ce77272430fcf83ef17b
2017-03-19 23:16:34 -04:00
Andras Timar
b17d64a854 switch to 5.3
Change-Id: I21cf56f8d061453c4ff3f609ea81a5604e12b78c
2017-03-18 21:56:19 +01:00
Michael Meeks
50661924b7 Dump much more ClientSession state, and also websocket latency. 2017-03-18 15:03:04 +00:00
Michael Meeks
0d8809f0ca Get warning logic right on wakeup socket. 2017-03-18 15:03:04 +00:00
Michael Meeks
b8b5cc2069 Shorten time to send first ping - to assess socket latency.
Also ensure we never send a ping on a non-upgraded websocket.
2017-03-18 15:03:04 +00:00
Henry Castro
caf55527d1 loleaflet: fix the date format of the annotation object
Change-Id: Idc323f51e610c784ddc2a4624c0ddf8881c8170c
2017-03-17 21:31:53 -04:00
Henry Castro
92a5320694 loleaflet: insert annotation now pops in the cursor position
Change-Id: I6bdfc0cd8a9603cf10685dc5562afd6d81d52162
2017-03-17 21:01:33 -04:00
Henry Castro
91649dc4b6 loleaflet: remove line arrow to replace the text selection
Change-Id: I20a85c65463930c3f60c47fc770b68d191887fda
2017-03-17 19:07:27 -04:00
Michael Meeks
a6a4094e52 Send ping message, handle pong & store ping-time on the Websocket. 2017-03-17 22:59:03 +00:00
Michael Meeks
9381d4134f Unify and simplify timeout and poll events setup.
Both happen at the same time, and need support from the
SocketHandlerInterface.

Rename hasQueuedWrites to getPollEvents and merge updateTimeout.
2017-03-17 22:00:28 +00:00
Henry Castro
3190483d7c loleaflet: convert anchorPos to L.Bounds
Change-Id: I8fb648ec52e21a93a1f76fe44224e5481a697453
2017-03-17 17:35:05 -04:00
Michael Meeks
3a5ca4b03f Switch to std::chrono from Poco::Time and simplify lots. 2017-03-17 21:13:11 +00:00