Commit graph

4148 commits

Author SHA1 Message Date
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
Andras Timar
2e12fade82 Updated Slovenian translation 2016-10-20 22:39:22 +02:00
Ashod Nakashian
693d6ccdbf bccu#2104 - writer: undo/redo doesn't invalidate properly
Change-Id: I9b3ee76cfde2c15ae59bb393070224c9f14ab586
Reviewed-on: https://gerrit.libreoffice.org/30109
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-20 15:14:21 +00:00
László Németh
7f72553236 loleaflet: traffic log and automatic typing in tile debug mode
- show outgoing and incoming network messages with some
  highlighting in Javascript console (default in tile
  debug mode)

- add optional automatic typing

- add layer controls for overlays and automatic typing

- differentiate rectangle borders (newer is more opaque)

- fixes:

  - fix function call at cancelled tiles

  - hide all attribution control when disabling debug mode
2016-10-20 16:25:05 +02:00
Henry Castro
e189f60ad4 loleaflet: refocus map due drop down insert table 2016-10-20 09:31:27 -04:00
Pranav Kant
49f4e696e5 loleaflet: Click user item to go to its cursor
Change-Id: Iac87da20cfe422000eb9a32ccad50e8483637616
2016-10-20 17:22:36 +05:30
Andras Timar
0cdc9d70b5 loolwsd: fix error: declaration of ‘isLoaded’ shadows a member of 'this' [-Werror=shadow] 2016-10-20 11:03:24 +02:00
Pranav Kant
9f69359b33 loleaflet: Disable these toolbar buttons too, in readonly mode
Change-Id: I8bc661dd3cfd689c7c7ded367deacdba853153e4
2016-10-19 21:08:33 +05:30
Pranav Kant
1be2a78564 Handle WOPI's UserCanWrite to determine readonliness
permission= parameter in URL is still supported, but overridden
by UserCanWrite parameter.

Also, introduce a new protocol message, perm: which dictates
loleaflet about the permission rather than the other way around
(only in case of WOPI)

It is to be noted that by default loolwsd assumes very
restrictive permissions, so not providing UserCanWrite in WOPI
implementation by a WOPI host would lead to opening of only
readonly session.

Change-Id: I2013c1661fd491c79bb367a41e1a7036fa03f984
2016-10-19 20:47:20 +05:30
Pranav Kant
ef32f30017 loolwsd: Fix a crash due to invalid fileinfo
Throw if document load fails. Ignoring such a scenario would lead
to crash later in the document load process.

Change-Id: Ie80fc4f26e08e4920d4c04726f947edd2837a0cf
2016-10-19 15:51:29 +05:30
Andras Timar
1f2be91009 loleaflet: updated port files 2016-10-19 11:53:18 +02:00
Michael Meeks
8d4c5d4e68 Avoid deadlock when notifying users of document load failure. 2016-10-18 21:51:33 +01:00
Tor Lillqvist
ece9740926 Use LOOLProtocol::getAbbreviatedFrameDump() 2016-10-18 17:00:45 +03:00
Tor Lillqvist
24442a080c Introduce LOOLProtocol::getAbbreviatedFrameDump()
Produces a human-readable logging string describing a LOOL protocol
frame. To be used for re-factoring snippets of similar code that
sometimes print also the flags, sometimes pointlessly print the
(binary) contents of a CLOSE frame (as if it was text), etc.
2016-10-18 16:57:14 +03:00
Tor Lillqvist
53b718844f Add a FIXME for some sillyness
One thing works mainly by accident, another is inefficient.
2016-10-18 16:32:04 +03:00
Tor Lillqvist
b0c870cbeb Expand documentation for getAbbreviatedMessage()
It has always been the intent that getAbbreviatedMessage() is for
producing human-readbale nice output for logging purposes only. But
this has not been mentioned, so (naturally) the function has been
misused. Sigh.
2016-10-18 16:26:30 +03:00
Tor Lillqvist
e87cf1e5d8 Adapt to new URI format in the GET request 2016-10-18 12:29:05 +03:00
Tor Lillqvist
38ccbd0196 We can use LoolException::toString() in one more place 2016-10-18 09:45:02 +03:00
Tor Lillqvist
620c08a32d Bin pointless copy-pasted (?) code snippet
We did not use the 'request' variable for anyhthing.
2016-10-18 09:09:13 +03:00