Commit graph

2197 commits

Author SHA1 Message Date
Ashod Nakashian
2a65f2e397 loolwsd: invoking disconnect on the session from Connection deadlocks
Connection thread should not attempt to disconnect the session,
which in turn will try to unload the document, which will
wait on the connection to destroy. The latter will never
happen since the connection destructor must, correctly,
wait for its thread to finish, which is waiting on itself now.

Since the session disconnect is already called from the session
destructor, there is no need to explicitly invoke it here.

Change-Id: Iaf9e8a10d4caa9001208084e909a14b4d4c5105e
Reviewed-on: https://gerrit.libreoffice.org/23966
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-10 17:19:55 +00:00
Ashod Nakashian
85641d934e loolwsd: for consistency always remove edit lock before taking it
Change-Id: Id24d6737fc3af77097058b28a77d6ca2d757cb9e
Reviewed-on: https://gerrit.libreoffice.org/23965
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-10 17:18:49 +00:00
Ashod Nakashian
60531e7def loolwsd: removed redundant session count in DocumentBroker
The sessions container already has the number of sessions.
No need for separate counters to track them.

Change-Id: I838865e2b8a843e87e81a6cc1226bcacd774b032
Reviewed-on: https://gerrit.libreoffice.org/23964
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-10 17:18:25 +00:00
Ashod Nakashian
e85d726c6c loolwsd: use the first valid session for auto-saving
Change-Id: I3d860c9f91de56f84ae93dc93688cd4898128107
Reviewed-on: https://gerrit.libreoffice.org/23963
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-10 17:15:18 +00:00
Andras Timar
39203290d8 bump version number, because we branched off 1.5.x 2016-04-10 12:53:06 +02:00
Tor Lillqvist
8d77460738 Add one minor thing 2016-04-10 10:44:45 +03:00
Tor Lillqvist
ec1ae85ddb Bin some obsolete lines 2016-04-10 09:40:28 +03:00
Tor Lillqvist
1409702282 Do include what you use even if it apparently gets included indirectly anyway 2016-04-10 09:37:51 +03:00
Tor Lillqvist
df2048c895 No need for <condition_variable> here 2016-04-10 09:36:36 +03:00
Tor Lillqvist
8bd0cb7543 These member variables are not used any more 2016-04-10 09:33:03 +03:00
Tor Lillqvist
3717c0ed27 Bin some unused static member variables 2016-04-10 09:31:56 +03:00
Tor Lillqvist
bdecb37f72 'make check' seems to work much better currently 2016-04-10 09:27:59 +03:00
Tor Lillqvist
fc87a51a69 No fifoCV/fifoMutex any more
(I did not bother checking whether they were just renamed, of whether
the same anti-pattern is present in some other place.)
2016-04-10 09:25:54 +03:00
Henry Castro
9ae7fa5b9b loolwsd: wait until bridge is completed 2016-04-10 00:18:48 -04:00
Ashod Nakashian
21e6ac23ea loolwsd: prevent ctrl+tab from inserting tab characters
Change-Id: I10b32a3e8ea1c8f80fadc9a8e6502b1a8bd322cc
Reviewed-on: https://gerrit.libreoffice.org/23953
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-10 04:15:57 +00:00
Ashod Nakashian
dc137081a7 loolwsd: session container can be private to DocumentBroker
Change-Id: I1539f2ec3ab1bd11d659dab11359cf25a46e1f97
Reviewed-on: https://gerrit.libreoffice.org/23952
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-10 04:15:11 +00:00
Ashod Nakashian
e6d0882791 loolwsd: moved autosave to DocumentBroker
Autosaving is done by DocumentBroker, which
tracks the last save time.

There are two triggers: idle and auto save.
The first triggers when sufficient time passes
after the last interaction the user had with
the UI (currently 30 seconds).
The second triggers when it's been more than
5 minutes since the last save.
Both triggers are conditional on the user
being active after the last save.

The new code auto-saves doesn't issue
a save command per session, but only
one per doc.

Change-Id: Iada15c16002e70710d2c13a3dcfdab036d8935c6
Reviewed-on: https://gerrit.libreoffice.org/23951
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-10 03:37:06 +00:00
Ashod Nakashian
8c1e5057fd loolwsd: last activity time updates ignores non-interactive commands
Change-Id: I763c2945f6acb30bea9d04d91982e9fb0c8ca6ca
Reviewed-on: https://gerrit.libreoffice.org/23950
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-10 03:35:09 +00:00
Ashod Nakashian
213888c45c loolwsd: logging and remove unused vars
Change-Id: Iff4cf5284a959caf84ce6ca5072623b6f95315df
Reviewed-on: https://gerrit.libreoffice.org/23949
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-10 03:33:38 +00:00
Ashod Nakashian
b6d2edb0e3 loolwsd: moved activity tracking into LOOLSession
Change-Id: I87d5afc43bea29ede2ad6e2871c594c4746bc3d5
Reviewed-on: https://gerrit.libreoffice.org/23948
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-10 03:32:58 +00:00
Ashod Nakashian
6a907a7a7f loolwsd: preFork is done once by ForKit already and sanity check count
Change-Id: I8ee843e35198ef88bdf191c11a2a738fae6e6c30
Reviewed-on: https://gerrit.libreoffice.org/23947
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-10 03:28:25 +00:00
Ashod Nakashian
70e8132866 loolwsd: correct handling socket buffer size and exception handling
Change-Id: I3eb28405c8f30a98c1b1e9644e9303d6074337e3
Reviewed-on: https://gerrit.libreoffice.org/23942
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-09 19:56:11 +00:00
Ashod Nakashian
e5846ee2cc loolwsd: supress unused-result and log error
Change-Id: I0ca04d5d9e18fdda6c2dca29386dbcc9a6df7784
Reviewed-on: https://gerrit.libreoffice.org/23941
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-09 19:55:42 +00:00
Ashod Nakashian
435b706f9a loolwsd: must include Poco/Version.h to define POCO_VERSION
Change-Id: I7dbabff60a9fe100caff2af357b8539126c3c003
Reviewed-on: https://gerrit.libreoffice.org/23940
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-09 19:55:18 +00:00
Michael Meeks
5b8f49423d More kit unit testing tentacles. 2016-04-09 18:29:20 +01:00
Michael Meeks
b308792801 Add infrastructure to inject test pieces into loolforkit. 2016-04-09 18:17:12 +01:00
Pranav Kant
9444bb2b87 loolwsd: update documentation about editlock
Change-Id: Id819a2e2d0739a773c5a01ec7bc80152c03bf8f0
2016-04-09 01:52:17 +05:30
Pranav Kant
9469021f74 consistency, server -> client messages ends with a colon
Change-Id: Ia2154603bf0b9432beeaae970f68daa1ea7f7ebd
2016-04-09 01:46:03 +05:30
Jan Holesovsky
b76140cb7b loleaflet: Trigger locontextmenu event with the context menu structure. 2016-04-08 19:15:08 +02:00
Jan Holesovsky
156d52b82e loolwsd: Add handling of contextmenu: command. 2016-04-08 19:15:08 +02:00
Jan Holesovsky
756cb64203 Update LOK headers to the latest ones. 2016-04-08 19:15:08 +02:00
Michael Meeks
3e618a97e3 Tests: add timeout, and test for timeout. 2016-04-08 17:36:08 +01:00
Tor Lillqvist
d0309d9a83 No reason to use unsigned instead of bool 2016-04-08 17:17:13 +03:00
Tor Lillqvist
40914ca336 Initialise the Connection::_joined in the constructor
This seems to get rid of the "terminate called after throwing an
instance of 'Poco::SystemException'" problem for me at least.

Sigh. Why can't the compiler warn about such things? I build with
clang++ -Wall -Wextra. The Connection class is fully defined inside
the LOOLKit.cpp so it should be able to, right?
2016-04-08 17:16:28 +03:00
Tor Lillqvist
7d82e059a2 Make Util::signalName() return a const char *instead
Makes its use in handleTerminationSignal() and handleFatalSignal()
less complicated.
2016-04-08 16:06:39 +03:00
Tor Lillqvist
913723e581 Include the "SIG" prefix in Util::signalName() 2016-04-08 15:32:30 +03:00
Tor Lillqvist
4129b7b84e Don't use strsignal(), use Util::signalName()
Presumably it is only developers that are interested in signals, and
terms like SEGV or ABRT are more precise than their textual
descriptions like "Segmentation violation" or "Aborted".
2016-04-08 15:31:47 +03:00
Tor Lillqvist
f7612b989a Give a potential handleFatalSignal() time do its job
Sleep a second before exiting in case we get a fatal signal just when
about to finish, which sadly seems to happen often. (In fact, if
handleFatalSignal() is running at the same time, it will kill the
process so we never get to the _Exit() call.)
2016-04-08 15:22:52 +03:00
Tor Lillqvist
fb0f31d2e8 Print a backtrace on fatal signals 2016-04-08 15:22:22 +03:00
Tor Lillqvist
407f688cb6 Include config.h to get ENABLE_SSL 2016-04-08 14:49:33 +03:00
Tor Lillqvist
cc4791ec49 It is customary to define ENABLE_FOO as 1 2016-04-08 14:35:17 +03:00
Tor Lillqvist
3b5f126b89 Typo 2016-04-08 14:30:48 +03:00
Tor Lillqvist
cc166639ef For more safety (?), catch Poco::Exception in general, not just IOException
Also, display more information about the exception.

Actually I think I should factor out the code to display as much
information as possible from an exception. Currently the amount of
information displayed varies from case to case in the code-base.
2016-04-08 14:28:52 +03:00
Andras Timar
3f0d5a7521 loleaflet: allow HTTP-only mode for testing/trial 2016-04-08 13:16:49 +02:00
Andras Timar
f75a27e3db loolwsd: --disable-ssl option 2016-04-08 13:16:49 +02:00
Tor Lillqvist
c08d35dd15 Add comment 2016-04-08 13:12:21 +03:00
Tor Lillqvist
48bc23f3ce Drop unnecessary variable 2016-04-08 13:09:06 +03:00
Tor Lillqvist
ca4d8ea451 ChildCounter is never incremented or decremented 2016-04-08 13:07:33 +03:00
Tor Lillqvist
481afd0306 Exit bluntly in all cases from a loolkit process 2016-04-08 11:48:02 +03:00
Tor Lillqvist
84650ea2df Use std:: prefix for cstdlib functions 2016-04-08 11:46:42 +03:00