Commit graph

4247 commits

Author SHA1 Message Date
Michael Meeks
cca657c8f2 Apply the pre-branch rename script to re-organize the source. 2016-11-25 09:58:48 +00:00
Michael Meeks
4432aba25b Revert "loolwsd: support reading long messages directly"
This reverts commit 84607b43a3.

LOOLWebSocket piece requires a much too recent Poco.
2016-11-25 09:48:59 +00:00
Michael Meeks
a2058341a3 Revert "loolwsd: kill receiveFrame with char* and cleanup usage cases"
This reverts commit 45c1856c6a.

This patch requires a very bleeding edge Poco, reverting for now.
2016-11-25 09:46:01 +00:00
Pranav Kant
47699cd908 tdf#98484: Handle spaces in chrome when IME is enabled
When IME is enabled and user presses the space button, firefox
sends 'compositionend' event with data = ' '. However, chrome
instead fires 'textInput'
event. Lets listen for 'textInput' event too and treat it like
'compositionend' event when data = ' '.

Change-Id: Icbebdf2e89f608f790e6ce68c49f474364e7d5ab
2016-11-25 14:42:12 +05:30
Pranav Kant
e9dbfa3953 tdf#98484: IME support - handle full string in compositions
Parse the compositionend event's string, convert each into a char
code and pass them individually to server.

Change-Id: If79d538ccaebaa29749a5ca48a1f6ed5e0689ed5
2016-11-25 10:08:27 +05:30
Ashod Nakashian
45c1856c6a loolwsd: kill receiveFrame with char* and cleanup usage cases
Change-Id: I64585f8992407e0a3ff26fba1dccd327de13b7ff
Reviewed-on: https://gerrit.libreoffice.org/31185
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-25 03:50:09 +00:00
Ashod Nakashian
84607b43a3 loolwsd: support reading long messages directly
Since Poco receiveFrame expected the buffer to be
at least as large as the frame, otherwise the socket
had to be closed, we sent a 'nextmessage' frame
before sending large frames with the payload size.

This caused many problems, not least related to threading
and lack of atomicity when sending large frames.

There is another API in Poco that doesn't have this
strict requirement, one that expects Poco::Buffer
and resizes it as necessary.

One potential issue is the possibility that a malicious
attacker might send very large frames to force the
server into allocating large buffers to read them,
thereby destibilizing the server, if not bringing it
down altogether.

Change-Id: I05014d54c3a1464f629ed82d761a7a65e4941985
Reviewed-on: https://gerrit.libreoffice.org/31184
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-25 03:48:32 +00:00
Ashod Nakashian
96a1a796c4 loolwsd: AdminModel cleanup
Change-Id: I2f73b0063b905b641e14110af6421191bc9b2533
Reviewed-on: https://gerrit.libreoffice.org/31183
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-25 03:47:32 +00:00
Ashod Nakashian
c8c8407e00 loolwsd: move ver field in tile to the end
tile and tilecombine have grown organically
and gained optional fields when originally
all fields were required.

Since internally we deduplicate them, we need
to compare the required fields and not the
optional ones. By moving all optional ones
after the landmark ver, we make comparison
easier and, hopefully, less error prone.

Change-Id: I309185d3e19a45c7d59bc872e8a76acd3c511c14
Reviewed-on: https://gerrit.libreoffice.org/31182
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-25 03:46:10 +00:00
Ashod Nakashian
f7ee76cbde loolwsd: simplify duplicate message detection
Change-Id: I54b9d7905a429c35c60062b51203db56d639b6b5
Reviewed-on: https://gerrit.libreoffice.org/31119
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-25 03:40:23 +00:00
Henry Castro
63e002d695 loleaflet: fix default image path 2016-11-24 23:24:31 -04:00
Henry Castro
8317cd46f1 loleaflet: scrollable special character dialog 2016-11-24 14:00:41 -04:00
Henry Castro
0ba3c23c87 loleaflet: do not allow empty option element 2016-11-24 10:19:54 -04:00
Andras Timar
c8fa6cb5b0 loleaflet: disable zoom for spreadsheet even on touchscreens 2016-11-24 15:12:14 +01:00
Pranav Kant
b8a21852b7 loleaflet: Display menu items always in a straight line
... even if the screen size is smaller than the menu size.

Change-Id: I93c579b7503ec98fadd62718ca8062ed7a564042
2016-11-24 16:51:24 +05:30
Pranav Kant
33393a4254 loolwsd: Handle zero jitter
While some value of jitter is default in debug builds, one should
easily be able to disable this latency stuff using env. variables
LOOL_WS_DELAY=0 LOOL_WS_JITTER=0

Change-Id: I345df8f48adc69b5f237f18c981172441d21c757
2016-11-24 15:09:23 +05:30
Ashod Nakashian
430e0cf021 loolwsd: alert users of low disk space after loading
Change-Id: I01426aafb353ac8e291969936afc4d276898f0f0
Reviewed-on: https://gerrit.libreoffice.org/31121
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-23 14:44:52 +00:00
Ashod Nakashian
c26e180c08 loolwsd: correct locking of DocBrokers
Change-Id: I52f10e06cf91db451eb34d6540d17db2e0d14385
Reviewed-on: https://gerrit.libreoffice.org/31120
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-23 14:44:38 +00:00
Ashod Nakashian
55c1e7568f loolwsd: kill redundant exception logging
Change-Id: I86ea48c4deaa42d164d2b0963931081d78d5f3ff
Reviewed-on: https://gerrit.libreoffice.org/31118
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-23 14:43:39 +00:00
Pranav Kant
a149a0c2e1 tdf#103679: Don't always change document permission on error
Have a new event 'warn' which doesn't change the document
permission but just show the user dialog with some message.

Change-Id: I455168e4f7315acdcccfb31fc8c70b86bbc6caad
2016-11-23 18:01:21 +05:30
Pranav Kant
f8e0b8c11e tdf#103679: Handle storage diskfull & other PutFile errors
The new behavior is to warn the user when we try to save to
storage and set all the sessions of
the opened document to readonly, if storage server has no disk
space left. In case of WOPI, this is intimated by HTTP response code 413 -
request entity too large.

If save operation to storage failed due to reasons other than
413, just warn the user and let it continue editing the document.
We can add more reasons of failure and act accordingly in future.

Change-Id: I4b046fc38bbc0d752c89d90acb5991a958b76670
2016-11-23 18:01:21 +05:30
Miklos Vajna
b7065d603d DocumentBroker: clean up redundant member init
Change-Id: I5b8f7afe5329c2d1f8abb404c086dcd08c6f1a1f
2016-11-23 09:06:56 +01:00
Andras Timar
8d577c8d96 loolwsd: add LibreOfficeKit.hxx to tarball 2016-11-23 08:29:26 +01:00
Pranav Kant
96952ceafd loolwsd: unused param
Change-Id: If74ccb603337971076e93c03ac28a9d8b5115f61
2016-11-23 11:31:39 +05:30
Pranav Kant
81e4b052be loolwsd: -Werror=shadow
Change-Id: If346299e76e50eabde65a4c3aab7b529a8c09148
2016-11-23 11:15:05 +05:30
Ashod Nakashian
51c88c5fb7 loolwsd: avoid deadlocking when alerting all users
Alerting all users is done from different contexts.
One such is when loading a new document.

Since both alerting all users and loading documents
need to hold the same lock, this would deadlock.

The solution here is to differentiate between
external alerts and internal ones (to WSD).

The internal one expects to be invoked while holding
the lock, while the external one always takes the lock.

Care should be taking when alerting from within WSD to
avoid this deadlock.

Change-Id: Idf0e952db1216a3d161f22c7da51af16701f685b
Reviewed-on: https://gerrit.libreoffice.org/31102
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-23 04:45:30 +00:00
Ashod Nakashian
5d4aa36240 loolwsd: minor cleanups
Change-Id: I9f75b991e6f4bedcffe1dd86f2a5cff2a606bf89
Reviewed-on: https://gerrit.libreoffice.org/31101
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-23 04:40:24 +00:00
Andras Timar
a01ec99e90 loleaflet: updated pot file 2016-11-22 23:14:49 +01:00
Andras Timar
8b8b02e252 loleaflet: extract strings from Insert Character dialog 2016-11-22 23:12:14 +01:00
Tor Lillqvist
8743e4bc85 Add comment that testConnectNoLoad does not fail all the time 2016-11-22 20:16:16 +02:00
Tor Lillqvist
c1fc1b33ab Change a few spurious messages to go to stderr as they should
Stdout is supposed to only get the "HTTPWSTest::testFontList. : OK"
style output.
2016-11-22 20:07:11 +02:00
Pranav Kant
6debf76cd3 loolwsd: Use document owner always, if available, to autosave
Change-Id: I826cbac642579261ca76d7cc5602c5d39a1587cb
2016-11-22 23:11:56 +05:30
Pranav Kant
c06c0f83c2 loolwsd: Set document owners unconditionally
Change-Id: I99b1ff4c30700a93a32f1a944704aee2b4b08ca8
2016-11-22 23:11:56 +05:30
Tor Lillqvist
8c2520a4ea testTilesRenderedJustOnceMultiClient seems to always fail nowadays 2016-11-22 19:34:41 +02:00
Henry Castro
1c1ecf20f6 loleaflet: add double click to insert the symbol 2016-11-21 22:43:21 -04:00
Henry Castro
5e143c813d loleaflet: process command values .uno:FontSubset 2016-11-21 22:13:46 -04:00
Pranav Kant
3c2337cfc5 loolwsd: Random latency simulator - delay, jitter in websockets
Only enabled in debug build. Default values for base delay is
10ms and jitter 5ms.

Override using LOOL_WS_DELAY, LOOL_WS_JITTER env. variables

Change-Id: I50502613075d6f73365623b93eb17748fe96fcc3
2016-11-21 16:18:50 +05:30
Miklos Vajna
c989ead6b8 DocumentBroker: fix uninitialized getInfoCallDuration
It was written in one conditional branch and was read in an other
conditional branch. So make sure no uninitialized data is read.

Change-Id: I230c6a4d3b048ee9d7f96881baf00eb041204ff0
2016-11-21 10:04:17 +01:00
Tor Lillqvist
8fe58df759 An updated preview of a slide should be broadcast to all document clients
Amazingly, this (my third attempt) seems to work.

Add a boolean 'forAllClients' parameter to the loleafget getPreview()
function, and pass it as true in the location where a new preview of
an edited slide is requested.

Add a parameter 'broadcast' to the 'tile' (request) message. Set to
'yes' in the above case. When subscribing to a such tile rendering,
subscribe all sessions of the document.

While at it, drop the default values for the parameters of the
TileDesc constructor. I dislike default values...

Change-Id: Idb438f11c953d791fafe4c890e0497d8dfbaa733
Reviewed-on: https://gerrit.libreoffice.org/29591
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2016-11-21 07:07:18 +00:00
Pranav Kant
4f5813b88e Refactor this unit test, indentation + fix some silliness
Change-Id: I382a187fa863ecb8d8ed81ed5b21acb08b14b9b1
2016-11-20 22:47:51 +05:30
Pranav Kant
93a5c95285 loolwsd: Incorrect URL in logs
Change-Id: I45a385d9f2866e6220869674ab131cbe7edc3c4e
2016-11-20 22:47:51 +05:30
Ashod Nakashian
7f29a11bf3 loleaflet: don't show disconnection notice when inactive
Users aren't bothered with connection errors when inactive.
Instead, when they try to re-activate, the connection is
re-established, and only if that is not possible does
the user see the disconnection notice. Otherwise,
the connection is re-established semi-transparently
(the is a small "connecting" status shown at the bottom).

Change-Id: If4735cc1593c6e29c65d3c9686a8f2861365c583
Reviewed-on: https://gerrit.libreoffice.org/31026
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-20 15:52:28 +00:00
Pranav Kant
57790dd2b8 loleaflet: Let readonly/view modes change slides
Change-Id: Ia4eef3f20cd0cc33c76de1070e09c8d4c8a6c4c8
2016-11-20 14:57:15 +05:30
Pranav Kant
8f3b5bff4c loleaflet: Let readonly/view views change spreadsheet tabs too
Change-Id: If443a71a4e009657ec7d29582a96f4c23962cfe3
2016-11-20 14:53:22 +05:30
Pranav Kant
4e945eefdf loleaflet: Do not grey out for disabled context menus
Change-Id: Id3bf5db6054e5df9511c491452ef164faa3289f9
2016-11-20 14:51:49 +05:30
Pranav Kant
7312aaced7 loleaflet: More sane names
Change-Id: Idc47e84cd1242e61c98b9caa5eed28dd3d1912e4
2016-11-20 14:50:23 +05:30
Pranav Kant
61af82792f loleaflet: Rename to spreadsheet-tabs-container
Change-Id: I08d57e55e4963beefb2aa3d26b05da75a5fd0ba6
2016-11-20 14:41:32 +05:30
Pranav Kant
8a2c2ad91d loleaflet: Don't unnecessarily update map bounds
This leads to emission of 'docsize' event somewhere down the line
which leads inconsistencies while navigating the document.

Change-Id: Iffabac66153e7b32c9b2af041282ef82b813bef3
2016-11-20 14:15:12 +05:30
Ashod Nakashian
fe10c1d272 loleaflet: close open dialogs before showing close frame
Change-Id: I833ec51f47106dc42b7e9d2412f03256721b270d
Reviewed-on: https://gerrit.libreoffice.org/31005
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-20 00:27:09 +00:00
Ashod Nakashian
efe6b96738 loolwsd: privatize ShutdownFlag and add public getter
Change-Id: I129fa8dda907758730bb494d1da950f48c61abbc
Reviewed-on: https://gerrit.libreoffice.org/31004
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-20 00:26:40 +00:00