Commit graph

2262 commits

Author SHA1 Message Date
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
8f9d812806 loleaflet: We do not use underscores in identifier names
Change-Id: Ic466bb3067353c9d271ea264a323502a03ed2c2b
2016-04-13 11:47:22 +05:30
Pranav Kant
df0315f317 loleaflet: Change message on status bar when document is saved
... and empty the status bar when document is modified and not
yet saved on server.

Change-Id: I976405783f744b875b9f6ee7e700006bddf5bc6f
2016-04-13 11:45:56 +05:30
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
Pranav Kant
ef2638298a loleaflet: listen to composition events
Treat 'compositionend' event as 'keypress' event with composited
data.

Change-Id: Ia1d35e3ce2c583259dc6b6179741050ed173fe64
2016-04-11 15:38:19 +05:30