Commit graph

3966 commits

Author SHA1 Message Date
Andras Timar
67d21d682d loleaflet: typo: initalized -> initialized 2016-10-24 20:52:52 +02:00
Andras Timar
e302993791 loolwsd: remove unused defines 2016-10-24 16:37:56 +02:00
Pranav Kant
d50d3f5b77 loleaflet: Fix missing comma, semi-colons etc
Change-Id: Ic47e6e44a83c43ff7aea840fb6b04d1ad7c4e4a2
2016-10-24 16:26:35 +05:30
Pranav Kant
36fece8b07 loolwsd: Separate WOPI load duration and check fileinfo duration
Add both of them and send them as wopiloadduration to the client,
if storage is WOPI.

Change-Id: I5652d346d70f473624f03536469acf45470db742
2016-10-24 16:04:28 +05:30
Pranav Kant
050bf4c65e loolwsd: Remove this comment - this is fixed now
Change-Id: I032c7e4a1609b68882dba6cc48ebd3fb2d59b8f5
2016-10-24 12:21:33 +05:30
Ashod Nakashian
b26f2f2738 loleaflet: prevent the zoomlevel from changing on connect/disconnect
When a client connects or disconnects ViewInfo message is sent.
The handler for this updates the number of users via addView
and removeView. Unfortunately when the toolbar control is
updated, it resets the zoomlevel to 100% (the initial value).

This is an ugly hack to change it back to the correct
value, since nothing really visually changes. It certainly
could be improved by only correcting the toolbar.

Change-Id: I37294da2d9d1bc84e8cb3b7f634aadcfd80d6497
Reviewed-on: https://gerrit.libreoffice.org/30218
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-24 04:19:29 +00:00
Ashod Nakashian
b78e224f8d loolwsd: log the invalid/dead PID in exception
Change-Id: Ib523e34de3b354944c53ce0e6b5a7cab8fdb8cf3
Reviewed-on: https://gerrit.libreoffice.org/30215
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-23 21:21:05 +00:00
Ashod Nakashian
5802d7e8a1 loolwsd: show disconnected usernames in the document repair
By retaining the view-ID to username mapping of disconnected
users we are able to show a disconnected username in the
document repair dialog.

Change-Id: Id08790de31f92653381b6a1525caf044bd875479
Reviewed-on: https://gerrit.libreoffice.org/30216
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-23 21:20:54 +00:00
Ashod Nakashian
cecb87dfe3 loolwsd: don't wait after autosaving to rebalance children
Change-Id: Ifb44d0395e8f416e418711b09deed3eb7f57effa
Reviewed-on: https://gerrit.libreoffice.org/30214
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-23 21:19:53 +00:00
Ashod Nakashian
f4b4037f9e loolwsd: spawn new children when no forks are outstanding
This avoids always waiting until child spawning times
out by being smarter about whether or not there are
any children spawning to wait for.

Change-Id: I96a16ac35f90f70219d4153db9862cf2ee5b6a76
Reviewed-on: https://gerrit.libreoffice.org/30213
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-23 21:19:03 +00:00
Ashod Nakashian
70690f6dab loolwsd: remove dead DocumentBrokers
Change-Id: If9b24ac1e45454e21222699a00defa70acc4ed80
Reviewed-on: https://gerrit.libreoffice.org/30212
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-23 21:18:19 +00:00
Ashod Nakashian
f68ece0037 loolwsd: fix testMaxDocuments unittest
Checking for document limit must be done before allocating
a child process, otherwise the new child process will not
be cleaned up or released, thereby failing the test.

Change-Id: I99b1155bdacf2f0b7a24c7b7330d207e4c7beee8
Reviewed-on: https://gerrit.libreoffice.org/30208
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-23 21:14:46 +00:00
Ashod Nakashian
30df646311 loolwsd: check for termination flag before loading new documents
Change-Id: I4b7117ba255dd81f28ed1279814048e4311c2473
Reviewed-on: https://gerrit.libreoffice.org/30211
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-23 21:14:29 +00:00
Ashod Nakashian
0287d7141d loolwsd: logs around testMaxConnections
Change-Id: I0f9dc957fb95d501626e321b4e15472d077c0301
Reviewed-on: https://gerrit.libreoffice.org/30210
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-23 21:14:15 +00:00
Ashod Nakashian
195936ffa1 loolwsd: prevent configuring max_connections less than max_documents
It would be nonsensical to allow less connections than documents
since each document must, by definition, have at least a
single connection.

This prevents blocking new documents because of connection
limit. If that were the intention, max_documents should be
lowered to match max_connections.

Change-Id: Ide07e977f548ed917c6e51a2ba88f3cc07947efe
Reviewed-on: https://gerrit.libreoffice.org/30209
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-23 21:13:51 +00:00
Ashod Nakashian
f0c3365f9f loolwsd: improve ChildProcess cleanup
Change-Id: I9852f04021097800d5ab0ce775f26fada5f3c8e7
Reviewed-on: https://gerrit.libreoffice.org/30207
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-23 21:11:19 +00:00
Ashod Nakashian
20b98906bd loolwsd: avoid superflous noise where possible
Change-Id: Idb9180d81e471da965152175aa3c327b83613ab1
Reviewed-on: https://gerrit.libreoffice.org/30206
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-23 21:10:32 +00:00
Ashod Nakashian
47ed5e40dd loolwsd: kill assertIsNotLocked
It was intended to assert that the *same* thread
hadn't locked, not any. As it stands, it's problematic
and was decided to let go.

Change-Id: Iddb76f0edd62b7cdca062c2aa924b08e3d7952ef
Reviewed-on: https://gerrit.libreoffice.org/30205
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-23 21:09:43 +00:00
Ashod Nakashian
0279fca436 loolwsd: Unit-Prefork threading fixes and cleanup
newChild is not thread safe and accessing _childSockets
must be accessed under the lock. This fixes
a segfault and merges getMemory with newChild.

Change-Id: I523c3c31d465118f263f7cb09d84105946e19720
Reviewed-on: https://gerrit.libreoffice.org/30204
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-23 21:09:19 +00:00
Ashod Nakashian
785fd972f4 loolwsd: cleanup dead children before balancing
Change-Id: I782080bb83973a795e2c967d91b152095678a93e
Reviewed-on: https://gerrit.libreoffice.org/30203
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-23 21:08:21 +00:00
Ashod Nakashian
a69a67e81b loolwsd: don't do in catch what might have thrown in try
Change-Id: I36d039f573529545c878d30e25f3884e2b4afeb2
Reviewed-on: https://gerrit.libreoffice.org/30202
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-23 21:07:21 +00:00
Ashod Nakashian
166b14a83a loolwsd: cleanup testBarren
Change-Id: I5affeb7938e3b1373043e86799c991ef84d9b191
Reviewed-on: https://gerrit.libreoffice.org/30201
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-23 21:06:56 +00:00
Ashod Nakashian
2644b39d5a loolwsd: use the container to track number of DocumentBrokers
Change-Id: Ic2d88eb6265365f8ffc99c9117a2a4383018e519
Reviewed-on: https://gerrit.libreoffice.org/30200
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-23 21:06:40 +00:00
Ashod Nakashian
6c0be6d90d loolwsd: move admin updates into DocumentBroker
Change-Id: Ic35198a7e4457a775fac25954279501e37b94b42
Reviewed-on: https://gerrit.libreoffice.org/30199
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-23 21:05:28 +00:00
Ashod Nakashian
2e9b3ae247 loolwsd: admin cleanups
Change-Id: I1ed9cdfe1c78665722ed517218ce45055c661b69
Reviewed-on: https://gerrit.libreoffice.org/30198
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-23 21:05:20 +00:00
Ashod Nakashian
05a967e827 loolwsd: two new tests for tile rendering
Tiles are checked for correct count and whether or
not they are serviced from cache or rendered.

One test is done with a single view and another
with four views.

Change-Id: Ieadeef8547097d4a53fb1ce42c56c33ec16d849f
Reviewed-on: https://gerrit.libreoffice.org/30197
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-23 21:02:10 +00:00
Ashod Nakashian
5c7c825e94 loolwsd: correct parsing of renderid in testSimultaneousTilesRenderedJustOnce
Change-Id: I7c3610c43e5506f3548006b8724afb21e771342c
Reviewed-on: https://gerrit.libreoffice.org/30196
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-23 21:01:18 +00:00
Ashod Nakashian
6486977ca7 loolwsd: cleanup testEachView
Change-Id: I5f2b6bf0f437b27c536fee9d1020b616a4ea215f
Reviewed-on: https://gerrit.libreoffice.org/30195
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-23 21:00:59 +00:00
Ashod Nakashian
58bf5bbf37 loolwsd: throw on unexpected errors in getResponseMessage
Tests should read errors and parse them if they are
expected. Otherwise, we should not ignore them and move
on, because they are (by the above definition) unexpected.

Change-Id: I9d7a9fb23879044ac4f11461e92c5f6fd6b03fa1
Reviewed-on: https://gerrit.libreoffice.org/30194
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-23 21:00:22 +00:00
Ashod Nakashian
85c1a0d868 loolwsd: no warning for a fairly common case
Change-Id: Ic461de074295eda4f15b6b7a8f787fc2624908ce
Reviewed-on: https://gerrit.libreoffice.org/30193
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-23 20:59:43 +00:00
Ashod Nakashian
77dde6ea71 loolwsd: ltrim returns the output to pass result as argument
Change-Id: Idc49996f5e24d634fefdc20a15d69c550c9df6ac
Reviewed-on: https://gerrit.libreoffice.org/30192
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-23 20:59:19 +00:00
Ashod Nakashian
027da26b5b loolwsd: kill redundant function
Change-Id: I8ef30205794c13e5b89e9f32ba0ec17df4441ef4
Reviewed-on: https://gerrit.libreoffice.org/30191
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-23 20:59:00 +00:00
Ashod Nakashian
452888060d loolwsd: cleanup and improve getResponseMessage
Proper parsing of incoming messages and better
prefix matching is done, as well as slightly
better logging when we timeout or hit exceptions.

Change-Id: I11adbf24a5505f6cda4a18ba855898dc5f82e238
Reviewed-on: https://gerrit.libreoffice.org/30190
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-23 20:58:45 +00:00
Ashod Nakashian
e5c9f61dd4 loolwsd: log possible document modifying calls in LOKit wrapper
Change-Id: I439460347c598a54af74d264dbde2670cf3542ac
Reviewed-on: https://gerrit.libreoffice.org/30189
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-23 20:57:35 +00:00
Ashod Nakashian
1a0ba1e41b loolwsd: remove redundant log entry for each recieved message
Change-Id: Ia072388cdc52271d3c3578a39614a9e390380c6f
Reviewed-on: https://gerrit.libreoffice.org/30188
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-23 20:57:14 +00:00
Ashod Nakashian
5c7905d4cc loolwsd: when parsing messages don't parse binary data
The last key=value entry of a message with binary payload
will not be parsed with space alone, since it is followed
immediately by a new line.

To parse these cases correctly we need to break at newline
as well.

Change-Id: I43fff48362a69dc91f36860014d49d128c0edb68
Reviewed-on: https://gerrit.libreoffice.org/30187
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-23 20:57:03 +00:00
Ashod Nakashian
167f0bf70c loolwsd: throw an exception rather than rethrow nothing
Change-Id: I1b85978d3049b39a15fded31582c2d6a62d90689
Reviewed-on: https://gerrit.libreoffice.org/30186
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-23 20:56:22 +00:00
Andras Timar
660eeab9da Pootle server times out with IPv6 address... 2016-10-23 16:44:56 +02:00
Andras Timar
a502371c27 loleaflet: updated uno command translations 2016-10-23 16:01:52 +02:00
Henry Castro
ea45bdb1f9 loleaflet: add hide/show row/column to header context menu 2016-10-23 08:44:04 -04:00
Michael Meeks
fe3e726211 Work around race in admin unit test. 2016-10-22 17:09:39 +01:00
Michael Meeks
b6291f9cb5 Unit tests new-style now search for a free port pair. 2016-10-22 16:43:42 +01:00
Michael Meeks
f8746373a7 Handle exceptions during websocket shutdown. 2016-10-22 16:43:42 +01:00
Michael Meeks
0b93441eff Improving the built-in unit tests.
Connect sockets to the local process using the details we can introspect.
Implement unit test for storage / load failure.
Cleanup tile-cache test a little.
2016-10-22 16:43:41 +01:00
Michael Meeks
dcd68c1850 tests: re-direct output to the console for unit tests, to make logs useful. 2016-10-22 13:09:28 +01:00
Pranav Kant
ba23ab2927 loleaflet: Expose some context menu item for comments
Change-Id: I242755c67f904ffbaaac63db24d735a9bfaa6bca
2016-10-21 23:34:49 +05:30
Michael Meeks
715b5c0101 Visible user error on unit test timeout. 2016-10-21 17:30:01 +01:00
Michael Meeks
ae04deada8 Restore ability to inject prisoner requests. 2016-10-21 17:30:01 +01:00
Michael Meeks
15d090a0b0 Define TDOC globally. 2016-10-21 17:30:00 +01:00
Michael Meeks
c015fecb2c Improve logging of WOPI protocol errors. 2016-10-21 10:17:40 +01:00