Commit graph

5327 commits

Author SHA1 Message Date
Ashod Nakashian
1a6f6e9a65 wsd: trigger child and doc housekeeping upon terminating kit
Change-Id: I7ffbadb40221c19b24fd172d1b9aabcaa8c581e5
Reviewed-on: https://gerrit.libreoffice.org/35787
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-03-28 05:14:22 +00:00
Ashod Nakashian
0624904500 wsd: flush sockets using timed loops
Change-Id: If6cc6194aa36a770913b777a8f19617fea6ba4a7
Reviewed-on: https://gerrit.libreoffice.org/35786
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-03-28 05:12:36 +00:00
Michael Meeks
e26079eecb tdf#106797 - avoid locking up / crashing on exceptions from main. 2017-03-27 20:15:30 +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
0b129c05a9 Find libpng on Ubuntu also
Change-Id: Ib0ed1b26ddac1aca6381650c85e17a4b1a6d017f
Reviewed-on: https://gerrit.libreoffice.org/35749
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2017-03-27 10:03:07 +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
Miklos Vajna
c1e8fc5334 wsd: fix libstdc++-4.8 build
error: no viable conversion from returned value of type 'bool' to
function return type 'std::shared_ptr<DocumentBroker>'

Change-Id: I5d4215ce61e5327ab702dbf6e4cc7be1330afed2
2017-03-27 09:18:36 +02:00
Samuel Mehrbrodt
460da71ce2 Use hub link for git log
Change-Id: Iaf4a6f5568f2e84d8261756607a62598a7144df1
Reviewed-on: https://gerrit.libreoffice.org/35656
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2017-03-27 07:15:10 +00:00
Ashod Nakashian
6d7f39356c wsd: flush sockets before exiting DocBroker poll thread
Change-Id: Id5384c113bd761b5b8c25286f1bd5a28051c63d3
Reviewed-on: https://gerrit.libreoffice.org/35740
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-03-27 03:21:38 +00:00
Ashod Nakashian
fddb86744e wsd: stop DocBroker poll thread when poll is flagged to stop
Change-Id: I1bfc3a4e0a0cc7753d330a009bb295c0fce9efca
Reviewed-on: https://gerrit.libreoffice.org/35739
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-03-27 03:21:04 +00:00
Ashod Nakashian
f2f0040275 wsd: use isCorrectThread
Change-Id: Id63c30b19489d590b995e0ea66ef2f44e8cddfb7
Reviewed-on: https://gerrit.libreoffice.org/35738
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-03-27 03:20:43 +00:00
Ashod Nakashian
5ae94cc7ec wsd: onConnect takes shared_ptr and better logging
Change-Id: I175dfa1f28444b9bb1f612242ee44b6d0507272c
Reviewed-on: https://gerrit.libreoffice.org/35737
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-03-27 03:20:22 +00:00
Ashod Nakashian
2a049cf60f wsd: kill unused code
Change-Id: I09fb52f0455e45e7217b290d5355019e14b9dbc1
Reviewed-on: https://gerrit.libreoffice.org/35736
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-03-27 03:19:35 +00:00
Ashod Nakashian
f1c371555a wsd: kill unused headless stuff
Change-Id: Ic4ee7603ecd7acd10e4499457de181342f2d7483
Reviewed-on: https://gerrit.libreoffice.org/35735
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-03-27 03:19:11 +00:00
Ashod Nakashian
b69d5683c3 wsd: log messages upon construction
Change-Id: Id8f2eeaa1fabf538af0c327a971d35cc17cb3596
Reviewed-on: https://gerrit.libreoffice.org/35734
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-03-27 03:18:29 +00:00
Henry Castro
d99dbade2b loleaflet: handle annotation reply for Calc documents
Change-Id: I27d03313bf4cdc43e7356e78424ee236b90c5269
2017-03-26 11:55:04 -04:00
Henry Castro
5e67e19a6c loleaflet: handle annotation reply for Impress documents
Change-Id: I47edbc8807f5f7aa5a28b3a4fd79aeebc8026262
2017-03-26 11:16:49 -04:00
Henry Castro
563b90a20a loleaflet: remove save button of the annotation object
Change-Id: I1aa19e3620d1bbd3a76fae32e97c4c32adcf0fe6
2017-03-26 10:19:10 -04:00
Henry Castro
6da38c8244 loleaflet: fix when an annotation is removed from Calc documents
Calc server does not respond with cellPos property when an annotation
is removed

Change-Id: I7c15e112c549f10277fb2fb51bc12b3f16f5fc88
2017-03-26 10:11:27 -04:00
Ashod Nakashian
5eed6575df wsd: don't pretent there was a recent save on creating DocBroker
Now the poll thread can exit immediately when loading
fails, since we don't think there is an active
saving on going.

Change-Id: I602b2b506f92309d34ec697553bac05523d70e20
Reviewed-on: https://gerrit.libreoffice.org/35714
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-03-26 05:12:34 +00:00
Ashod Nakashian
1c5896f302 wsd: count connections symmetrically
ClientSession::onDisconnect might not always be
called. The disymmetry between incrementing in
the ctor and decrementing in onDisconnect always
ran the risk of mismatch and leaking connection
counts, eventually blocking new clients.

Change-Id: I39ec65016984c0cddd0e16cfbf201049ced53713
Reviewed-on: https://gerrit.libreoffice.org/35713
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-03-26 05:12:12 +00:00
Ashod Nakashian
25dee367d4 wsd: load the convert-to doc in callback
Since this a fake session that doesn't
have a client socket, we push the
messages directly into the ClientSession.
But since the DocBroker poll thread will
probably not be ready by then, there
is no child process and the other
document bits needed to load (or indeed
process any client messages).

So we defer all the fake messages in
a poll callback to insure they are done
in the correct order.

Change-Id: Id81dc4288b305829149e6e9c81d0f7da719c59ad
Reviewed-on: https://gerrit.libreoffice.org/35712
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-03-26 05:11:30 +00:00
Ashod Nakashian
e9e36ba848 wsd: reduce main poll timeout to recover child processes faster
Change-Id: Ic5c43df9df7d50e101a8ed3c84ed12a113da1f2b
Reviewed-on: https://gerrit.libreoffice.org/35711
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-03-26 05:10:59 +00:00
Ashod Nakashian
c3e67575a7 wsd: reject the client's connection when destroying the doc in question
Change-Id: Ieb437c9a35af6e809a08e5835aabb18db3934040
Reviewed-on: https://gerrit.libreoffice.org/35710
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-03-26 05:10:33 +00:00
Ashod Nakashian
c25d63b0d4 wsd: more stable testCloseAfterClose test
Change-Id: Iac9392dbe455ddc3e4742a5f239c1f78f2bfe2ac
Reviewed-on: https://gerrit.libreoffice.org/35709
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-03-26 05:09:48 +00:00
Ashod Nakashian
c1ffb64904 wsd: correct shutdown status code echoed back
Change-Id: Ieb685135ab280ed76070af3392bfa69cf313f35a
Reviewed-on: https://gerrit.libreoffice.org/35708
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-03-26 05:08:46 +00:00
Ashod Nakashian
3895897213 wsd: improved socket logging
Change-Id: Ib4751a5a73b7ec0c7ca319f552d5e0aaff06ffea
Reviewed-on: https://gerrit.libreoffice.org/35707
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-03-26 05:07:37 +00:00
Ashod Nakashian
a085f7998b wsd: more informative testConnectNoLoad and error handling
Change-Id: Ide2c546d1bbe10b8bb0996bd454dcfd4906ba2fe
Reviewed-on: https://gerrit.libreoffice.org/35706
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-03-26 05:06:58 +00:00
Ashod Nakashian
d3a8106cda wsd: remove NewSessions
Sessions are now added to the DocBroker
_sessions map and loaded from the poll
thread first before processing their
messages.

Since messages are not read from the
sockets outside of the poll thread,
there is no reason to queue them
at all. The only exception is when
messages are passed directly
to ClientSession during convert-to
requests. That will be handled
separately (for now convert-to test
fails).

Change-Id: I798166b9e45b5707a33d31137e01a32ce63630b1
Reviewed-on: https://gerrit.libreoffice.org/35705
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-03-26 05:06:22 +00:00
Ashod Nakashian
a190084b43 wsd: log document loading stats only the first time
Since these numbers are against the thread start time,
they aren't useful for loading subsequent views.

Change-Id: Ib5cf580282841e5b2dbb71c7db4a1868f7eb29e1
Reviewed-on: https://gerrit.libreoffice.org/35704
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-03-26 05:05:14 +00:00
Ashod Nakashian
bd00aa4057 wsd: assert isCorrectThread
Change-Id: I90bfa9ba6b47e657db28a3680fa8a13ef2553a6e
Reviewed-on: https://gerrit.libreoffice.org/35703
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-03-26 05:04:54 +00:00
Ashod Nakashian
a57b9e6917 wsd: const correctness
Change-Id: I2bba04ccba9fd97e10ecc56f7db1f62a66a8f5f0
Reviewed-on: https://gerrit.libreoffice.org/35702
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-03-26 05:04:24 +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
Pranav Kant
5c8fb67863 loleaflet: Redline has only textRange property
Change-Id: I534f327cb71cddec4b3437f17f92ee4b24ed488a
2017-03-23 17:54:58 +05:30
Pranav Kant
5bb6e203c5 loleaflet: Accept, Reject redlines buttons in main annotation win.
Change-Id: I16b931c07485eb98fdac00d1dc968a4c9251a02a
2017-03-23 17:34:35 +05:30
Pranav Kant
092d93d5ef loleaflet: Do not set width explicitly
Container will automatically adjust its width as according to the width
of the containing child table or other elements.

Change-Id: I0a18dc5263d05eb8c67d342d4acf5f7c4bae128c
2017-03-23 17:10:51 +05:30
Pranav Kant
b0b7e5abe3 Revert "loleaflet: ensure visible element before getting bounds"
This reverts commit a759a01c7d.
2017-03-23 16:39:01 +05:30
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