Commit graph

1750 commits

Author SHA1 Message Date
Tor Lillqvist
69a6167f0e Use better test names 2016-03-03 17:31:13 +02:00
Tor Lillqvist
06f56e646d Test harder 2016-03-03 17:14:15 +02:00
Tor Lillqvist
2fab757462 We use a recursive mutex, so no need to drop and re-take around documentLoad()
The callbacks from documentLoad() are made in the same thread.

Sure, as such it is not a good thing to use recursive mutexes. If we
switch back to non-recursive mutexes, we will have to stop taking the
lock in callbacks from documentLoad(), i.e. make sure we know those
functions aren't used elsewhere, in places where a lock would be
needed. Or something.
2016-03-03 17:14:15 +02:00
Jan Holesovsky
2590cd186e loolwsd: LOK_CALLBACK_PARTS_COUNT_CHANGED was removed from the API. 2016-03-03 11:13:34 +01:00
Jan Holesovsky
b442680d90 loolwsd: Update the bundled LOK headers. 2016-03-03 11:08:25 +01:00
Pranav Kant
c5aa122fcb loolwsd: Create notification pipe
... and Admin and AdminModel containing all the required data
that we need to expose to Admin panel.

Admin processor will keep listening to any data on this
notification pipe and update AdminModel accordingly.

Change-Id: I0dd6f07ae60158733c34d17f53a35def70600513
Reviewed-on: https://gerrit.libreoffice.org/22780
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-03 03:34:47 +00:00
Tor Lillqvist
d55ba592b4 Log also when the syncChildren() is done
It does quite a lot of work that can produce very many lines of log,
so it is good to be able to quickly find when that is done when
perusing a log file.
2016-03-02 16:51:53 +02:00
Tor Lillqvist
bf63df227b The payload can be null
It is always null at least for LOK_CALLBACK_STATUS_INDICATOR_FINISH.
2016-03-02 16:41:49 +02:00
Tor Lillqvist
fa0fd3303d Avoid logging \r\n here, too 2016-03-02 14:55:04 +02:00
Tor Lillqvist
38ddcf5243 Don't log the CR LF at the end of a response 2016-03-02 13:12:27 +02:00
Tor Lillqvist
02913dcbfc Use std:: consistently for cstdlib functions 2016-03-02 08:47:13 +02:00
Tor Lillqvist
73282c50d6 Make preinit the default. Turn off with LOK_NO_PREINIT 2016-03-02 08:26:15 +02:00
Tor Lillqvist
78579b3e57 Don't pretend to support non-Linux here either 2016-03-01 18:30:07 +02:00
Tor Lillqvist
d5292541bd Revert "Also chown the random devices to root:root and chmod to 666"
Not needed after all. It was a red herring. The device files work fine
even if not owned by root:root and with mode 664. The actual problem
was that I used a file system mounted with nodev when testing loolwsd.

This reverts commit 509314d559
2016-03-01 18:24:55 +02:00
Tor Lillqvist
4f701d5d84 Avoid aligning equal signs on sequential lines in a few arbitrary places
If we would use such style, we would need to do it consistently.
2016-03-01 17:28:47 +02:00
Tor Lillqvist
a959e99004 Make declaration of writeFIFO() match definition 2016-03-01 17:17:14 +02:00
Tor Lillqvist
8bc05765bf Make writeFIFO() return total number of bytes written if successful
That is probably what was the intent. As originally written, in case
the function encountered partial writers, and had to do several
write() calls, only the number of bytes written by the last one was
returned.

Luckily the actual return value of writeFIFO() is not used
anywhere. It is just tested for being negative.

Still there is the problem that if at first one or several write()
calls succeed but don't write the whole buffer, and then a write()
fails, the caller has no way to know that the buffer has been
partially written. But that is hopefully highly theoretical and there
is no sane way to handle such a situation anyway.
2016-03-01 17:15:40 +02:00
Tor Lillqvist
dc305b2b08 Don't confuse Poco::Util::Application::ExitCode and EXIT_SUCCESS/FAILURE
The getChildStatus() and getSignalStatus() functions returned the
latter, still the returned values were compared against
Poco::Util::Application::EXIT_OK. (Sure, both Poco's
Application::EXIT_SUCCESS and stdlib.h's EXIT_OK are zero, but that
doesn't mean one should mix them up.)

Also add two comments pondering the meaning of the code.
2016-03-01 16:49:12 +02:00
Tor Lillqvist
f560c64471 Document where LOOLExitCode comes from 2016-03-01 16:34:32 +02:00
Tor Lillqvist
248703c6f7 Bin leftover declaration of variable that is not defined anywhere 2016-03-01 16:28:56 +02:00
Tor Lillqvist
ec33f7b96a Don't use pre-increment when there is no need
We are not interested in the variable being assigned an incremented
value. Its value is not used any more. We are just interested in the
value of the variable plus one. Using pre-increment gives the wrong
impression.

Sure, this is nit-picking.
2016-03-01 15:53:35 +02:00
Tor Lillqvist
673b08bb81 We know that there is a = in the arg as we found a string that includes it
No need to to test again whether it is found. Also, std::strchr()
works fine.
2016-03-01 15:50:39 +02:00
Tor Lillqvist
f8aad3d31f Use the std:: versions of C standard library functions
As mentioned in the coding style part of README.
2016-03-01 15:44:22 +02:00
Tor Lillqvist
cdb0c08bb8 Let's be consistent 2016-03-01 15:27:36 +02:00
Tor Lillqvist
9cba13a53f Let's not pretend this could ever run on non-Unix
In fact, it is Linux-specific even, and has never successfully been
run on anything else, even if I tried for fun once to build it on OS
X.
2016-03-01 15:12:01 +02:00
Miklos Vajna
7c319aab33 ccu#1573 loleaflet: hide row headers of hidden rows
This is the row equivalent of commit
d14fccb67f (hide column headers of hidden
columns, 2016-02-26).
2016-03-01 13:46:03 +01:00
Tor Lillqvist
aa4fe42d24 English 2016-03-01 13:25:09 +02:00
Tor Lillqvist
0cf40c50ea Anybody interested can check git log 2016-03-01 13:11:00 +02:00
Miklos Vajna
33d1e1b888 loleaflet: add comment on how to test transparent tiles 2016-03-01 10:48:29 +01:00
Jan Holesovsky
70a60dbadc loleaflet: Move the contextMenu to dist/. 2016-03-01 10:44:20 +01:00
Jan Holesovsky
0b2bf15ddd loleaflet: Move the scrollbar to dist/. 2016-03-01 10:44:20 +01:00
Miklos Vajna
34fc0baacc loolwsd: indentation fixes in httpwstest
This file had a consistent style up to recently, keep it that way.
2016-03-01 09:55:06 +01:00
Miklos Vajna
f46a43b5f5 loolwsd: fix -Werror,-Wunused-parameter 2016-03-01 09:53:37 +01:00
Miklos Vajna
a010c01bd7 loolwsd: fix -Werror,-Wunused-private-field 2016-03-01 09:51:09 +01:00
Tor Lillqvist
70b7ee6d65 Fix typos 2016-02-29 16:46:42 +02:00
Tor Lillqvist
9d655cbcc0 Don't pretend this will work on anything except Linux 2016-02-29 14:25:12 +02:00
Tor Lillqvist
29a3f58f1a The loolwsd program does not need any capabilities
So don't give it any then.

Remove the --uid option and related attempts to handle running loolwsd
under sudo, to be able to debug it. Now with loolwsd not having
capabilities, it should work fine to just run it under a debugger
normally. (For the loolbroker and loolkit processes, attaching to an
already started process is the way to debug.)
2016-02-29 14:13:19 +02:00
Tor Lillqvist
f0d7438f88 Add one more thing 2016-02-29 13:06:08 +02:00
Tor Lillqvist
509314d559 Also chown the random devices to root:root and chmod to 666
Otherwise they won't work. Not that I know whether this helps
anything, really. At least the NSS crypto initialization still takes a
long time.
2016-02-29 12:15:22 +02:00
Tor Lillqvist
d489f69372 Log also capabilities before dropping 2016-02-29 12:12:18 +02:00
Tor Lillqvist
b75c6a34b0 Grammar 2016-02-26 16:53:58 +02:00
Tor Lillqvist
e7a0b4f524 Mention one more problem 2016-02-26 16:52:27 +02:00
Andras Timar
d14fccb67f hide column headers of hidden columns 2016-02-26 15:31:35 +01:00
Tor Lillqvist
188ca79a6b Always complaining 2016-02-26 13:27:20 +02:00
Tor Lillqvist
ab3169ecdc Add some more Log::info() calls
We want to be able to see exactly when document loading and password
management is done and how long it takes.
2016-02-25 16:43:51 +02:00
Tor Lillqvist
3cad8c183a Seems that 10 seconds is not enough
One has to love arbitrary retry counts and timeouts. Loading the
password-protected.ods in a loolkit process, with correct password
provided, takes 12 seconds on my machine. I think this slowness is
because the NSS code LO uses to do crypto wants to initialize its
crypto goodness in various ways that don't work so well inside a
chroot jail. Presumably it uses some wait with timeout when attempting
to do something which doesn't succeed. For instance it tries to run
netstat -in. (In an interactive LibreOffice the doc loads fairly
instantly.) Oh well.
2016-02-25 16:22:07 +02:00
Tor Lillqvist
ff7a0ac8ee Add more verbose debug output...
Debugging this crack is really hard.
2016-02-25 15:57:55 +02:00
Tor Lillqvist
d88a798469 There is no setDocumentPassword() in ChildProcessSession 2016-02-25 14:36:50 +02:00
Tor Lillqvist
4b5e799a33 Split testPasswordProtectedDocument() into three
It does three separate things, and the first two intentionally result
in errors, and the server probably disconnects after errors. Not
sure. This is horrible, horrible.
2016-02-25 11:02:35 +02:00
Tor Lillqvist
bbcc2c43da I think it makes more sense to output to std::cout here
Because that is where cppunit outputs, I am told, so less chance of
out-of-order mixing, maybe.
2016-02-25 10:31:36 +02:00