Commit graph

3825 commits

Author SHA1 Message Date
Jan Holesovsky
f101b2b7cb Check we get views prioritized according to when the cursor was updated.
Fails with any of e5adf272b8,
d9c90e30fd or
4e7ba53a2b reverted.

Change-Id: I5a9384f20ae1f64e29509ec568670e29c3c4eb94
2016-09-30 22:22:23 +02:00
Jan Holesovsky
e5adf272b8 Search harder for the highest priority tile.
Without this, any cursor intersecting with the tile was treated as the
priority.

Change-Id: I6bc4629620d368ce383900386a00c535255ee133
2016-09-30 22:02:40 +02:00
Miklos Vajna
81a114c47d DocumentRepair: still show the absolute time as a tooltip
Change-Id: I64cbf519e53c2a2ad697deb9932fb7a32e702d25
2016-09-30 17:44:54 +02:00
Miklos Vajna
655915da05 leaflet: bundle timeago JS module
And start using it in DocumentRepair.

Change-Id: I8d2b8af4d2e0dcc7cf8082c9d7adbc633df1c387
2016-09-30 17:12:01 +02:00
Andras Timar
d22cdad721 loleaflet: enable l10n of Update/Delete TOC commands 2016-09-30 16:33:38 +02:00
Miklos Vajna
d0abdee6d5 Move HTTPWSTest::testEmptyCellCursor() to WhiteBoxTests
Which is a unit test, so should be faster.

Change-Id: Id5c2ed705576a1467756ac8dba6e5e434b56f725
2016-09-30 15:52:08 +02:00
Miklos Vajna
38577b74fd Refactor to be able to unit-test Document::ViewCallback()
Change-Id: If07eb89e5d2f45737a8af10803511ab2ee3a07b3
2016-09-30 15:42:50 +02:00
Andras Timar
b4d3bfdcae expose Update TOC and Remove TOC context menu items in Writer 2016-09-30 15:36:29 +02:00
Tor Lillqvist
5b08fe6477 Add handling of dangerously low storage space for local files
Sends the same 'error: cmd=internal kind=diskfull' message as when
disk space for LOOL's own needs is getting full, but only to the
user(s) of that document. We can't in general know whether one
document in the Storage abstraction is located even close to another.
2016-09-30 16:12:16 +03:00
Miklos Vajna
3090981c8a Document repair: expose user names, not only view IDs
Also in leaflet replace the current user with "You" to be consistent
with the statusbar.

Change-Id: If2d76f078eeae3038f8ae17506ae7679f7b23023
2016-09-30 14:21:14 +02:00
Tor Lillqvist
3cabf7c9c1 testCalcEditRendering is not working so bypass it for now 2016-09-30 14:06:13 +03:00
Tor Lillqvist
9511bbda71 Re-factor Util::checkDiskSpace() into separate parts
We will later want to just to a disk space check for the file system a
file is on, without registering that file system for periodic checks.

Adapt callers to keep working like before.
2016-09-30 13:54:51 +03:00
Pranav Kant
ec88a53072 loleaflet: loleaflet-font for userlist items too
Change-Id: If2c96d9d70a84bac1e75816f07bb7da8ff2642f5
2016-09-30 15:49:24 +05:30
Pranav Kant
7b60a9e3f6 loleaflet: Show error message dialog on diskfull
Set the mode to viewonly after the error so that user can still
see the tiles downloaded from the server, but cannot interact
anymore before server administrator fixes the disk space.

Change-Id: If03f4fabe93458672a631c020d09dcebecbb955c
2016-09-30 15:22:12 +05:30
Pranav Kant
42fbfa936c loleaflet: Use 'error' event to open the alert dialog
Change-Id: I8f1ca3d896027755fe1291cb227ded102e57e112
2016-09-30 15:22:12 +05:30
Miklos Vajna
c9346e14b1 LocalStorage: differentiate between multiple localhost users
Hopefully useful in general, but currently I need this to see if view
ids are mapped to the correct user names even with file:/// URLs.

Change-Id: Iec7d552ee0b0d53738040d868e49ecb7e9c10843
2016-09-30 11:03:05 +02:00
Jan Holesovsky
bf80260a28 Let the make fail when the unittest fails.
Change-Id: I66a7e82b864f1c13c1c145c27f019b832c38bb62
2016-09-30 10:53:22 +02:00
Jan Holesovsky
0b5fa973da Run unit tests (that don't require loolwsd) during the build time.
Change-Id: I2b1ea4fb5e6dcd8e4eb5f3890507f541c1457b39
2016-09-30 10:43:51 +02:00
Miklos Vajna
8c2446d15b Revert "httpwstest: add tolerance, so that testCursorPosition actually passes"
This reverts commit 3629113e59. This
workaround is no longer needed, now that core.git
b32b6c09d190effbe29389a87a80df36007d2e99 (sw lok: disable pixel
alignment of cursor logic values, 2016-09-29) fixed the root cause.

Change-Id: I208e18517158cf55b143d1018ad0fd933db3accf
2016-09-30 10:20:57 +02:00
Miklos Vajna
827d5ed9c8 DocumentBroker: it's enough to build that temporary string once
Change-Id: I253874fefdb2dfe9bb22a8b3bef641499a49dcc9
2016-09-30 09:29:17 +02:00
Henry Castro
b4ba3c9c55 loleaflet: fix mege mistakes 2016-09-29 17:57:17 -04:00
Henry Castro
e766e82f3d loleaflet: fix undefined variables 2016-09-29 17:41:10 -04:00
Henry Castro
3fcde8be83 loleaflet: fix show dialog error
Conflicts:
	loleaflet/src/core/Socket.js
2016-09-29 17:38:48 -04:00
Henry Castro
6f7d67a204 loolwsd: control frames must have a payload of 125 bytes 2016-09-29 17:36:43 -04:00
Pranav Kant
d5f8c5b2e6 Change main websocket url for consistency with other urls
From
/lool/ws/docurl
to
/lool/docurl/ws

The main purpose behind changing this and other related urls is
to help in load-balancing. The first two parts of the URL can now
be used in a hash-based load-balancing algorithm which decides which
slave gets to serve the requests. Requests such as insertfile,
downloadas need to end up in the same slave in which document was opened.
/lool/docurl/ i.e first two parts of the URL are constant for all
the requests that should be served by a single slave.

Change-Id: Ibc605ca1251957b8b32b376cf19b78f6178fadfa
2016-09-30 00:50:57 +05:30
Pranav Kant
085a07b3e2 loleaflet: Ignore view messages before 'viewinfo' message
Change-Id: If0f759976f13a76c54c068a18bab5e07818cb86e
2016-09-30 00:33:58 +05:30
Pranav Kant
8330341a8a Include docurl in document download requests
From
/lool/jailid/randomdir/filename
to
/lool/docurl/jailid/randomdir/filename

Change-Id: I4d58e733768c62f2951ecfdcfcb604d99772862d
2016-09-30 00:33:58 +05:30
Pranav Kant
187abe0018 loleaflet: Remove unused fields
Change-Id: Ide180430cb2d359fa089ded8061af764c4001bb2
2016-09-30 00:33:58 +05:30
Pranav Kant
8c61ee3c94 Change insertfile URI to include doc key in it
From
/lool/insertfile
to
/lool/<docUrl>/insertfile

Change-Id: I63864673bc1d92a737a95b484c2f440cb5ce6605
2016-09-30 00:33:58 +05:30
Pranav Kant
12dee85ef8 Serve all assets (l10n, images etc.) versioned
Rather than accessing them using '/dist/', access them using the
version (git hash) in the url.

Change-Id: I999bd99a13dbf92b26641e3bd5c9e0b7468bb654
2016-09-30 00:33:58 +05:30
Jan Holesovsky
c8a97eb300 Move testTileQueue from WhiteBoxTests to TileQueueTests.
Change-Id: Ib592c425d595e1d3449092bd0b9008c1b857274a
2016-09-29 20:32:25 +02:00
Jan Holesovsky
ae179b8bce Move the TileQueue tests that do not require loolwsd to a separate file.
Change-Id: Iaac51e891a5c34cebc95d7631c95c84ed8aad80e
2016-09-29 20:04:05 +02:00
Tor Lillqvist
86bd8426d0 More work on disk space monitoring
Monitor the disk space on important file systems: The ones where
cached tiles are stored and where the chroot jails are created. Those
might be the same file system of course, the code checks and doesn't
do needless work.

The check is done whenever a new loolkit process is taken into use and
a new chroot jail it constructed, and whenever a new client session
connects to a document. We don't check more often than once a minute,
though.

Still need to add code to guard against running out of diska space
when saving documents back to where they were opened from. For that
presumably need to enhance the Storage abstraction.
2016-09-29 17:54:40 +03:00
Miklos Vajna
6941370d38 Update bundled headers
Change-Id: I51d680910f059ded5fba03d302fd95d822a73c64
2016-09-29 14:16:19 +02:00
Tor Lillqvist
2c93bd6e89 Document the 'pong' message
Should the 'pong' have a colon to match other server->client messages?
Consistency is a virtue.
2016-09-29 14:40:56 +03:00
Henry Castro
78b2fae7e9 loolwsd: test: update max connections 2016-09-28 18:16:09 -04:00
Henry Castro
7a1d02a7ce loolwsd: MAX_CONNECTIONS, should send HTTP status code
It is not necessary to throw a WebSocketException
2016-09-28 18:12:01 -04:00
Tor Lillqvist
96e6ad7502 Re-think disk full handling
Instead of trying to inform the sysadmin (which we did not yet try to
do in any meaningful way), inform all connected clients (even those
editing other documents).

We use 'error: cmd=internal kind=diskfull' as the message to the
clients. The loleaflet code needs to be updated to handle that
carefully by displaying a very prominent message that tells the user
that all bets are off.

Also add a unit test for the functionality.

Document the new protocol details.

The code for this alert functionalty became a bit less elegant than I
like because of the way we include Util.cpp in the unit test 'test'
program.

Still need to add code to check for disk full in more places, not just
when saving a cached tile or font. Probably we should even actually
check for disk space on the file system(s) we use getting alarmingly
low, not just check for file writing operations that fail. Later.
2016-09-29 00:23:14 +03:00
Tor Lillqvist
075c487001 Fix comment. There can be several ChildSessions in a kit process 2016-09-29 00:23:09 +03:00
Henry Castro
0729a38277 loolwsd: restore MAX_CONNECTIONS
Let's do another unit test with http request connections
2016-09-28 17:03:36 -04:00
Henry Castro
5e19aa635e loolwsd: test: connections and documents 2016-09-28 16:04:51 -04:00
Henry Castro
fe2004a06f loolwsd: rework bccu#2022, User warning on hitting limit 2016-09-28 16:01:53 -04:00
Henry Castro
940e78162f loleaflet: remove map attribution 2016-09-28 10:00:35 -04:00
Ashod Nakashian
0e03ac54e6 loolwsd: unittest fixes
Change-Id: I77f7b225c444ca0bc352de4b45b0ead4ad454714
Reviewed-on: https://gerrit.libreoffice.org/29361
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-28 13:28:31 +00:00
László Németh
0b454bccfc loleaflet: cleanup of tile debugging mode 2016-09-28 13:21:01 +02:00
Michael Meeks
86b36b8d6d Don't flush and write to the deflater from different threads concurrently. 2016-09-28 10:55:10 +01:00
Miklos Vajna
31867f669d Fix remaining uninitialized members
The missing init of mutexes is probably theoretical, the TraceFile and
the Unit ones were real errors, I think.

Change-Id: If19c23a9c93d34059998346af8d45c26a34043a6
2016-09-28 10:20:48 +02:00
Ashod Nakashian
71dfb9f7b7 loolwsd: localise locking in ChildSession
Avoid using the static mutex and instead use
the loKitDocument mutex when accessing the
latter. The static mutex is used only when
accessing the document manager. That is,
only when loading and unloading a document.

For ChildSession members that may
be accessed from both the callback and
incoming web-socket, guard them with the
member mutex.

Finally, move any local data manipulation
outside of locks altogether.

Change-Id: I046906bc6ed7e0b38c309f97836b38e27f9bfc8e
Reviewed-on: https://gerrit.libreoffice.org/29336
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-28 03:28:26 +00:00
Ashod Nakashian
dfeae15038 loolwsd: accessing the WS should be thread-safe
Change-Id: I490e9b720024b93099ca63d66e840db2c1931720
Reviewed-on: https://gerrit.libreoffice.org/29335
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-28 03:27:19 +00:00
Ashod Nakashian
4c7b015b68 loolwsd: use atomics for potentially shared flags
Change-Id: I36e34159cca24e2c3d99eaf4d4f36f3e008cb6ce
Reviewed-on: https://gerrit.libreoffice.org/29334
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-28 03:26:20 +00:00