Commit graph

1525 commits

Author SHA1 Message Date
Tor Lillqvist
5782e0b04c TileCache::lookupTile() already returns non-null only if the stream is open
No need to test at call sites. We can assert() as a sanity check
though.
2016-04-15 14:12:35 +03:00
Tor Lillqvist
ecaaab6e90 Default values for bool parameters make the code harder to read
In this case we always passed the parameter anyway.
2016-04-15 13:17:20 +03:00
Pranav Kant
cca858732a loolwsd: Allow admin console to kill documents (again)
Change-Id: I30405854e9ebdc56ab3477758e9008963d4b8efa
2016-04-15 15:25:01 +05:30
Tor Lillqvist
6ca6bf0da6 Rant about over-use of variables where literals would work 2016-04-15 12:26:56 +03:00
Pranav Kant
382da839e0 Add documentation about takeedit
Change-Id: I600046111d2478f1c02552d3caa60d2a50fa7c98
2016-04-15 14:48:58 +05:30
Pranav Kant
91c6154fc0 loolwsd: Use docKey as key for Admin instead of PID
Also change some variable names to be consistent with rest of the
coding style.

Change-Id: Icca9a9aec9bfb34c1edd5b6533d7646b05fe814f
2016-04-15 14:42:14 +05:30
Pranav Kant
7bf5e84a90 loolwsd: Make admin console work (again)
Change-Id: Ib51f33c60b5e42e154795357a7a787cb8691ad51
2016-04-15 13:28:42 +05:30
Pranav Kant
4f9eef9324 loolwsd: Be consistent, and use unique_lock
Change-Id: Idfc14bb7dd82827493865241f6d04cf9ae4a88fc
2016-04-15 13:28:42 +05:30
Pranav Kant
9669470d09 loolwsd: Admin doesn't need its own thread now
The timers are cancelled upon destruction of the static Admin
instance.

Change-Id: Ie43dc9d3ec96b002e12685ec997ad83c29b684d0
2016-04-15 13:28:42 +05:30
Tor Lillqvist
5c41d4c5ed -Werror=maybe-uninitialized 2016-04-15 10:53:06 +03:00
Miklos Vajna
0a92e811dc Storage: const auto -> const auto& where it would create a tmp copy
Change-Id: I0ec42200e19654ee2e1c9b0fc293668847a5b965
2016-04-15 08:49:35 +02:00
Henry Castro
39180a0e22 loolwsd: test: add connectLOKit
Connecting to a Kit process is managed by document broker, that it does several
jobs to establish the bridge connection between the Client and Kit process,
The result, it is mostly time outs to get messages in the unit test and it could fail.
connectLOKit ensures the websocket is connected to a kit process.
2016-04-14 21:54:36 -04:00
Ashod Nakashian
0b4b3c73d5 loolwsd: tile cache cleanup
Change-Id: Ib2abec83fd4866c09b30507c11a809d682c2f819
Reviewed-on: https://gerrit.libreoffice.org/24100
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-15 01:08:37 +00:00
Ashod Nakashian
322a3c1afe loolwsd: logging moved to own files
Change-Id: Idf1dd91cf37675e1bea8aeb5d9e8cf6d2ac9a725
Reviewed-on: https://gerrit.libreoffice.org/24099
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-15 01:07:13 +00:00
Ashod Nakashian
e5595509fd loolwsd: cosmetic cleanup
Change-Id: I02f3ab1778db462376b7563e7e8b0abeebd2e8a1
Reviewed-on: https://gerrit.libreoffice.org/24098
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-15 01:04:47 +00:00
Michael Meeks
fe684cc71d looltool: implement destdir, and fix parallelism. 2016-04-14 21:41:09 +01:00
Michael Meeks
444adc976d looltool cleanup add --no-check-certificate option too. 2016-04-14 20:44:02 +01:00
Michael Meeks
53c60b2842 Magic to cleanup autotools module linking of unit tests. 2016-04-14 18:58:18 +01:00
Michael Meeks
688d1ab6e6 Remove confusing ChildProcessSession include on LOOLWSD.
Move the ClientPortNumber into both Kit and WSD.
2016-04-14 18:58:18 +01:00
Michael Meeks
d817fc2c69 Simple command-line tool for file format conversion. 2016-04-14 18:58:18 +01:00
Andras Timar
1f7da1f5a2 loolwsd: install and package SSL key and certs if SSL is enabled 2016-04-14 18:47:50 +02:00
Henry Castro
bea5963aa7 loolwsd: avoid time out exception 2016-04-14 12:00:32 -04:00
Henry Castro
d11bd69c26 loolwsd: wait prison session until the peer is assigned
Some messages are not forwarded to the client session, this is caused
by the time the client session is assigned, the prison session,
it is already forwarding to not assigned peer session.
2016-04-14 11:41:15 -04:00
Andras Timar
8f93a5f526 merge loleaflet and loolwsd rpm packages 2016-04-14 17:08:52 +02:00
Tor Lillqvist
fe5f238c08 Exit when receiving an *unexpected* CLOSE frame
Otherwise we will just keep waiting for a line on input from stdin,
which is unhelpful.
2016-04-14 17:45:51 +03:00
Tor Lillqvist
066b48688a Use the 'expected' and 'actual' parameters of CPPUNIT_ASSERT_EQUAL() correctly 2016-04-14 17:07:55 +03:00
Tor Lillqvist
2edf15a18b Use CPPUNIT_ASSERT_EQUAL() to get expected and actual values into output 2016-04-14 17:05:09 +03:00
Andras Timar
2e0d895485 loolwsd: define sysconfdir for deb package 2016-04-14 15:26:51 +02:00
Andras Timar
ea94e957c1 loolwsd: rpm install of config files 2016-04-14 15:14:59 +02:00
Andras Timar
a8601804ac loolwsd: process loolwsd.xml.in 2016-04-14 15:06:49 +02:00
Andras Timar
a9fb211118 loolwsd: move loolwsd.xml to loolwsd.xml.in 2016-04-14 14:59:27 +02:00
Andras Timar
ec9aa4a50f loolwsd: fix SSL certs/key install 2016-04-14 14:50:48 +02:00
Andras Timar
1f560af63a loolwsd: discovery.xml to datadir 2016-04-14 14:43:31 +02:00
Andras Timar
b3e610eba0 loolwsd: do not install unit test shared libs 2016-04-14 14:43:31 +02:00
Tor Lillqvist
0140b1cd43 Always define ENABLE_DEBUG and _SSL in config.h, as 1 or 0
Correspondingly always use #if, not #ifdef, to test.
2016-04-14 13:43:31 +03:00
Andras Timar
60c969cd77 add security.h to tarball 2016-04-14 12:35:50 +02:00
Andras Timar
24bc458741 define LOOLWSD_CONFIGDIR and LOOLWSD_DATADIR 2016-04-14 12:34:11 +02:00
Jan Holesovsky
1e58864230 Revert unwanted change of hello.odt, and prevent that from happening again. 2016-04-14 11:40:17 +02:00
Pranav Kant
5d8e627ca4 loolwsd: Allow 'downloadas' for all kinds of views
... irrespective of whether the editlock is taken or not.

Change-Id: I159f78fb4c58c973458ae2c5bc53e844de689e14
2016-04-14 15:08:01 +05:30
Jan Holesovsky
7d64501479 Allow setting the server name and port in loolwsd.xml. 2016-04-14 11:13:55 +02:00
Tor Lillqvist
1bd6cdde3b Util::getSignalStatus() is unused
Good, its semantics was a bit odd anyway.
2016-04-14 11:39:42 +03:00
Michael Meeks
b3f17462eb Fix ENABLE_SSL AC_SUBST. 2016-04-14 09:34:52 +01:00
Michael Meeks
35b27b352c Initial font unit test. 2016-04-14 09:34:52 +01:00
Tor Lillqvist
c7d0067969 Util::getChildStatus() is unused
Good, now the odd LOOLExitCode can go away, too.
2016-04-14 11:30:28 +03:00
Miklos Vajna
63d9112977 MasterProcessSession: const auto -> const auto& where it would create a tmp copy
Change-Id: I5bbffb9be562b52f868bfca3f825e8d81dae4eef
2016-04-14 08:36:56 +02:00
Henry Castro
096f7db6d0 loolwsd: report indicator status before websocket is ready 2016-04-13 14:42:46 -04:00
Jan Holesovsky
efb67d68fd The host= parameter for loleaflet.html does not exist any more.
Now loolwsd fills that in directly.

Also show http:// or https:// in 'make run' according to the configuration.
2016-04-13 18:42:07 +02:00
Jan Holesovsky
b09b6eab89 Only the access_token (and _ttl) is supposed to be passed via the form post. 2016-04-13 18:32:00 +02:00
Michael Meeks
1eb92c0dc9 Cleanup and aggregate memory stats. 2016-04-13 14:35:30 +01:00
Tor Lillqvist
8d69c09dbc Expand on the 'busy wait' issue 2016-04-13 16:12:53 +03:00
Tor Lillqvist
4087ac8089 With "disconnect" messages gone, no need for a 'reason' to disconnect()
YAGNI.
2016-04-13 15:56:23 +03:00
Tor Lillqvist
c9796255ae Don't check for undocumented "eof" frames read from a websocket either
Now with "disconnect" frames gone, surely checks for "eof" ones can go
away too, whatever they were.
2016-04-13 15:50:09 +03:00
Tor Lillqvist
e5de11113b Don't check for or send "disconnect" frames anywhere and don't document them
Follow-up to 68b3a2c81e.
2016-04-13 15:49:10 +03:00
Tor Lillqvist
db14143d72 Make the loolkit process counting more reliable
Sleep in both places before counting them, and catch Poco exceptions
while counting (can happen for instance when a /proc entry goes away
while we are looking for its 'comm' file).
2016-04-13 15:33:56 +03:00
Pranav Kant
68b3a2c81e Always save irrespective of nature of socket close
Do not distinguish between normal shutdown or abnormal shutdown.
Also remove 'disconnect' frame to indicate normal shutdown.

Change-Id: I98fd9f5a219feb1097c57302dba14e08ad9bf143
2016-04-13 17:35:10 +05:30
Ashod Nakashian
65ee0a1cdd loolwsd: corrected etc file copying
Change-Id: Ie920bbdee38d4b0a338753a6d483e274052939ce
Reviewed-on: https://gerrit.libreoffice.org/24053
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-13 11:49:31 +00:00
Jan Holesovsky
7e67b38832 Add some paranoia... 2016-04-13 13:44:18 +02:00
Jan Holesovsky
484335321f Introduce LOOLWSD::SSLEnabled for runtime, and allow non-SSL access via WOPI. 2016-04-13 13:11:06 +02:00
Tor Lillqvist
726fd1f66d The CPPUNIT_TESTs I added a moment ago should be first and last in the list 2016-04-13 13:22:35 +03:00
Tor Lillqvist
00660cfe3d Sort #includes 2016-04-13 13:19:26 +03:00
Tor Lillqvist
b4ae5192bb bccu#1678: Add cppunit test that no extra loolkit processes are left over
The number of loolkit processes after running the cppunit tests should
be the same as before running them. (At least, that is the intention
at the moment, I think. If/when this changes, the test will have to be
adapted, of course.)
2016-04-13 13:17:43 +03:00
Tor Lillqvist
0f3d98d2d1 Try to use consistent indentation for parameters to SocketProcessors()
But yeah, not sure why the blocks of the lambdas are de-indented like that.
2016-04-13 12:22:19 +03:00
Tor Lillqvist
c8a46e78a8 bccu#1678: Check whether document can be discarded also in stop predicate
Seems to fix the problem that the loolkit processes hang around
forever even if there is no associated client.
2016-04-13 12:17:59 +03:00
Tor Lillqvist
04f3a9e111 It works better to set TerminationFlag
That global flag is checked all over the place, so setting it will
actually make the threads eventually finish. (All polling is done with
timeout, I think, and then checking TerminationFlag whenever the poll
times out.)

Sure, it would be much better to use an eventfd and poll that, too,
instead of timing out from the polls all the time to check a plain old
boolean flag.
2016-04-13 11:49:16 +03:00
Tor Lillqvist
26ceda2f15 More specific message 2016-04-13 11:49:00 +03:00
Miklos Vajna
4fac6c0126 DocumentBroker: can pass these by reference
Change-Id: I327e515e39671239b8699cfadcf61e088af68b13
2016-04-13 10:05:10 +02:00
Tor Lillqvist
8f3ec463b8 Change some cppunit assertion messages to match what is actually being asserted
If you can't come up with a meaningful message to use in a
CPPUNIT_ASSERT_MESSAGE(), just use CPPUNIT_ASSERT() instead. These
messages aren't intended for end-users but for developers, so it is
pointless to make them high-level and dumbed-down.
2016-04-13 09:58:18 +03:00
Pranav Kant
9ea4624839 loolwsd: Handle socket exceptions while trying to send frame
In case of abnormal termination of session from client-side,
we might still have data being processed in the kit process, for
example, during auto-save. Trying to send such data over an
expired socket towards the client would throw exceptions which
need to be handled, otherwise the auto-save process would not be
successful. Further, the unhandled exception can bring the document
broker in an unstable state with dockey still present in the
object.

Also do not send 'editlock: 0' to a websocket session which is
going to be removed because the session might have been
forcefully terminated from the client-side, in which case sending
data would go nowhere.

Change-Id: I10eb9c818bc81d4db26d5a19dc8bd44f6fbdf32c
2016-04-13 09:56:32 +05:30
Henry Castro
6701dc62ce loolwsd: response bad request 2016-04-12 17:45:25 -04:00
Michael Meeks
25a092d7de Add memory accounting metric to UnitPrefork.
Also add hooks to allow custom LOK <-> WSD message for this test.
2016-04-12 21:58:27 +01:00
Henry Castro
87639db612 loolwsd: test: remove temporary files 2016-04-12 14:34:25 -04:00
Henry Castro
c7abd16399 loolwsd: replace CPPUNIT_ASSERT_MESSAGE -> CPPUNIT_FAIL 2016-04-12 13:56:32 -04:00
Michael Meeks
6a990dfb61 Security bits and test cleanup.
Enforce user being 'lool' for setcap binaries loolmount and loolforkit.

Add warnings if configured without --enable-debug.

Developers should pass --enable-debug to configure.
2016-04-12 17:13:56 +01:00
Pranav Kant
ce64cab64d Update README about Admin changes
... since we have stopped using pipes for admin console.

Change-Id: If2c1814be453cf8c83da16dc78a287c856d9f278
2016-04-12 21:04:54 +05:30
Tor Lillqvist
ec9bc15de8 Make the exit status of run_test.sh reflect its result
Make it match the exit status of the actual ./test program.
2016-04-12 18:29:02 +03:00
Tor Lillqvist
241d421fc7 Kill the "lool_admin_notify.fifo" thing as it is not used
The loolwsd process created it and opened it for reading, but nothing
opened it for writing.

There is still documentation for it in README, that needs to be either
rewritten to match reality or removed.
2016-04-12 18:07:29 +03:00
Tor Lillqvist
745950ceb2 Improve error logging for the fifo creation 2016-04-12 17:57:58 +03:00
Tor Lillqvist
5c6e209567 Log creation and opening of fifos in more detail 2016-04-12 17:49:20 +03:00
Tor Lillqvist
6342c33dda ClientPortNumber is not static any longer 2016-04-12 16:04:59 +03:00
Henry Castro
53aea60ab1 loolwsd: fix -Werror,-Wshadow 2016-04-12 08:32:22 -04:00
Tor Lillqvist
9086f378d8 Pedantry 2016-04-12 14:48:26 +03:00
Tor Lillqvist
8dcd7d22e4 Remove a few more more leftovers from the "broker" terminology 2016-04-12 14:24:47 +03:00
Tor Lillqvist
479d461348 Add a debug option --careerspan to make loolwsd retire after that many seconds
Comes in handly in some testing situations where you don't want to
send a signal to get loolwsd to finish. Option is present only in an
--enable-debug build.
2016-04-12 13:57:45 +03:00
Pranav Kant
9efed29c1d loolwsd: Save using session holding the edit-lock
If the first session used to save does not hold the edit-lock,
all the .uno:Save commands will get converted to dummy messages
and never reach the kit process.

Change-Id: I36cbee778f8c2c5866dcf276cf156fdf9ed8388e
2016-04-12 16:12:23 +05:30
Tor Lillqvist
9c8e4988fa Bin the old --test mode of LOOLWSD
It hardly was relevant any more. The 'connect' test program can be
used for effectively the same kind of testing anyway.
2016-04-12 13:34:33 +03:00
Michael Meeks
cd2f70521b Cleanup configure.ac status messages. 2016-04-12 10:00:44 +01:00
Jan Holesovsky
280fafe03c Add a trivial autogen.sh. 2016-04-12 10:17:20 +02:00
Jan Holesovsky
3d17f3cc4d Add a missing autoheader call. 2016-04-12 10:09:10 +02:00
Tor Lillqvist
d7f107c532 Add m4, and re-order for clarity
Only have under the "Autofoo" comment stuff actually related to
autofoo or configury in general.
2016-04-12 10:49:57 +03:00
Jan Holesovsky
cc3ee1033b Make the autotools steps reliable. 2016-04-12 09:39:53 +02:00
Miklos Vajna
73985418c7 ${systemplate} -> @SYSTEMPLATE_PATH@ to fix make check
Change-Id: I5cb78fa3820c2e48fe071ba2b030b824a6780e10
2016-04-12 08:37:24 +02:00
Tor Lillqvist
255f9304e9 Fix build without --with-lo-path 2016-04-12 09:29:57 +03:00
Miklos Vajna
773dad57ba AdminModel: can pass these by reference
Change-Id: I1c9ff03c06a8de00162cb2987b7218209f514850
2016-04-12 08:09:42 +02:00
Michael Meeks
ea1e2493bf Re-factor tests, move jails & systemplate up a level into loolwsd.
Also generate the test scripts with config.status containing absolute
paths to make them easier to run, and enable the older unit tests.
2016-04-11 22:01:49 +01:00
Tor Lillqvist
0f3fa0e9d4 Don't log the payload inside a CLOSE frame
It is a status code, a 2-byte unsigned integer in network byte order,
potentially followed by a textual reason. But we never include any
specific status codes in the CLOSE frames anyway. (With a Poco-based
WebSocket peer it is always WS_NORMAL_CLOSE, 1000, 0x03 0xE8.)
2016-04-11 17:21:57 +03:00
Tor Lillqvist
ccf73d159d Mention libtoolize, and that building from tarball is simpler
(Is it?)
2016-04-11 17:04:19 +03:00
Tor Lillqvist
9929842a69 It is loolforkit that has capabilities now, not loolwsd 2016-04-11 17:00:11 +03:00
Tor Lillqvist
eb5fcdba93 Consistenly put a colon after the "editlock" in the message sent to the client 2016-04-11 13:31:03 +03:00
Tor Lillqvist
a1f4ded793 YAGNI: Drop parameter with default value that is never overridden
No non-default value is never passed. Just use the default value as such in the function.
2016-04-11 11:30:54 +03:00
Tor Lillqvist
6729bb7726 PipeReader::readLine() is used only internally by processOnce() 2016-04-11 11:23:33 +03:00
Tor Lillqvist
077a4436df Bin unused function PipeReader::process() 2016-04-11 11:21:18 +03:00
Tor Lillqvist
2623208c8f Rename MAINTENANCE_INTERVAL to something more descriptive 2016-04-11 11:17:27 +03:00
Tor Lillqvist
a598ea869c Use less misleading function and variable names
Also, get rid of one default parameter that was passed a non-default
value only 'internally'.
2016-04-11 10:14:26 +03:00
Miklos Vajna
ee1e036aa9 Util: strcpy -> strncpy
Change-Id: I03f50f4e5e7f404364fdf90197750bf7cd762c9c
2016-04-11 09:12:59 +02:00
Tor Lillqvist
1c9a6400b6 Make the testBadLoad() unit test pass again
The server sends an "editlock: 1" message even if no document has been
loaded. Ignore that while waiting for the "error:" message.
2016-04-11 10:00:45 +03:00
Tor Lillqvist
bde585a879 Make the time log messages make more sense semantically 2016-04-11 09:25:32 +03:00
Tor Lillqvist
9d4aeb86d1 I doubt we need nanosecond precision here in the logging
(As in "Most recent inactivity was 8096.000000 ms ago".)
2016-04-11 09:15:12 +03:00
Tor Lillqvist
dfd1782300 Probably we can drop the "30-second check" log output 2016-04-11 09:09:18 +03:00
Ashod Nakashian
abca88c7cf loolwsd: correction to prefork unit-test
Since WSD now takes into account the fact that
ForKit always spawns one child, the unit-test
shouldn't expect +1 preforked children.

Change-Id: I5cbe9d817a0d2ffdf9fb0953ef85450f7b8b224f
Reviewed-on: https://gerrit.libreoffice.org/23980
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-11 03:12:26 +00:00
Ashod Nakashian
63068a5dda loolwsd: command timeout is now a const
Change-Id: I9115f465fe760f4c388294bfb5e14cbb441c1174
Reviewed-on: https://gerrit.libreoffice.org/23979
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-11 03:12:06 +00:00
Ashod Nakashian
280669c253 loolwsd: save on disconnection
Last client disconnection now correctly issues a save
and waits for the confirmation before tearing down
the sockets, queues and threads.

Change-Id: I28c28d79a17d359e9aa1fe67b983ca9fb592b847
Reviewed-on: https://gerrit.libreoffice.org/23978
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-11 03:11:38 +00:00
Ashod Nakashian
1c0f608a59 loolwsd: broker sets edit lock on first session automatically
Change-Id: Icad57130ffb1953cf8c71d4675c116036684569a
Reviewed-on: https://gerrit.libreoffice.org/23977
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-11 03:10:13 +00:00
Ashod Nakashian
4cab42b20f loolwsd: logging improvements
Change-Id: Idba11b0ae18337d78ea504a455ddc9494cff7ef0
Reviewed-on: https://gerrit.libreoffice.org/23967
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-10 17:21:32 +00:00
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
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