Commit graph

1950 commits

Author SHA1 Message Date
Pranav Kant
4ecfb0da21 loolwsd: -Werror=shadow
Change-Id: Ic0bfead873ab7f0b9c177183c0f6d3179d097d96
2016-07-11 11:57:58 +05:30
Pranav Kant
a6187e6172 loolwsd: Reset document destroying states
These values are recalculated anyways now, when destroying the
document (See startDestroy())

Change-Id: Idfe4c48983556bb2b31ca0d6bf2ffcde84281a2d
2016-07-11 11:25:25 +05:30
Pranav Kant
06dc3fd1bc loolwsd: Give editlock correctly when adding a new session
This should be given to first editable(non-readonly) session.

Change-Id: I3b6e53df4b2450cc799c4b4e6a800f662d90a2c1
2016-07-11 11:25:20 +05:30
Pranav Kant
d18379adce loolwsd: Show only abbreviated message when reading from cache
Change-Id: I6d5c8984010e2917b9069df6ee3b0a28c678b297
2016-07-11 11:24:19 +05:30
Pranav Kant
62814d29cf loolwsd: Introduce a readonly mode
Specified when websocket is initialized. Documents once
opened in readonly mode cannot edit throughout the life of the session.
This is very much like present view mode except the ability to
change to edit mode.

Change-Id: I176e3bbf210c3383268d1a5b50dc17f0cbfb26b8
2016-07-11 11:24:16 +05:30
Pranav Kant
162619be72 loolwsd: Avoid such abbreviations
Change-Id: Id63c960e198b9c5d45026833a24d6330ca137d35
2016-07-11 10:23:29 +05:30
Pranav Kant
37b9226030 loolwsd: unused variable
Change-Id: I60d10e4390b7c114273f517fb66786861f37db60
2016-07-11 10:23:29 +05:30
Pranav Kant
3d306a0d7b loolwsd: Don't check canDestroy again
We do not need to check canDestroy again after removing the
session if sessionCount > 1, otherwise we end up with
force-saving also for the second last session.

Change-Id: Iea4736569d07d9b23f78b0f6407f78eca6090d67
2016-07-11 10:23:08 +05:30
Henry Castro
adf4369237 loolwsd: test: state changed UNO commands 2016-07-10 14:28:28 -04:00
Miklos Vajna
3df68f3869 loolwsd: support CPPUNIT_TEST_NAME, similarly to core.git 2016-07-08 09:04:28 +02:00
Ashod Nakashian
64741ebb87 loolwsd: dump calc tile for debugging purposes
Change-Id: Ie2d92026fb77a4f94d6434ec25fc10695118971e
Reviewed-on: https://gerrit.libreoffice.org/27022
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-07-07 20:27:34 +00:00
Ashod Nakashian
2c4efeb5f3 loolwsd: fix PreFork test
We could have up to 3 pipes and we should tollerate them
when testing for leaking FDs and pipes.

The 3rd is probably a file redirection.

Change-Id: I913072307646e62e1802587c9142b2eb8c9dd7bb
Reviewed-on: https://gerrit.libreoffice.org/27021
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-07-07 20:27:18 +00:00
Miklos Vajna
2419df6e60 Update bundled headers 2016-07-07 19:21:57 +02:00
Ashod Nakashian
0d6cb541a3 loolwsd: better handling of bad requests
Change-Id: Ib1c4dee227275efc9b481f76b9d9892f98be61e7
Reviewed-on: https://gerrit.libreoffice.org/27017
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-07-07 16:50:51 +00:00
Ashod Nakashian
ac9c109581 loolwsd: logging
Change-Id: I458743348e2e163f917f0fe43cc340d72556021c
Reviewed-on: https://gerrit.libreoffice.org/26994
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-07-07 03:51:12 +00:00
Ashod Nakashian
bb9168096d loolwsd: test fixes
Change-Id: I927bab6c88c72247a7bf6fb73ae56e1ebc51cdbd
Reviewed-on: https://gerrit.libreoffice.org/26993
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-07-07 03:50:16 +00:00
Ashod Nakashian
42f857efe0 loolwsd: cleanup of testTileInvalidateCalc
Change-Id: Ic15d12f0b203244b3de1b80e97866f134efd82f7
Reviewed-on: https://gerrit.libreoffice.org/26992
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-07-07 03:49:31 +00:00
Ashod Nakashian
0eba4a17f8 loolwsd: remove unnecessary wait for invalidatetiles in tests
Change-Id: Ica79b995ef14fbf7d57e9ef435c87a84d854d5b8
Reviewed-on: https://gerrit.libreoffice.org/26991
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-07-07 03:49:07 +00:00
Ashod Nakashian
370c21f4b5 loolwsd: fix testTileInvalidateWriter
Change-Id: I701c348cbfe55f850bb2180b400020d1b1b01f31
Reviewed-on: https://gerrit.libreoffice.org/26989
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-07-07 03:35:43 +00:00
Henry Castro
c7a655b54d loolwsd: doc: running unit tests 2016-07-04 15:38:21 -04:00
Andras Timar
801c8f4676 loolwsd: command line config override should work in non-debug builds as well ;) 2016-07-03 16:43:47 +02:00
Pranav Kant
0b8e9dedaf loolwsd: Print abbreviated message while saving to TileCache
Change-Id: I1f77062466e3672ce742b6a46e3c39b35ce70f31
2016-07-01 20:29:19 +05:30
Pranav Kant
d60da277e8 loolwsd: Follow symlinks while copying fonts into systemplate
Change-Id: Iee7f5b1dd3cb1884ac51f58c1b6c1ba2b73a7c30
2016-06-29 19:44:34 +05:30
Andras Timar
cdf14cea3e loolwsd: remove libmysqlclient18 from deb package dependencies 2016-06-28 10:10:37 +02:00
Pranav Kant
0f23d617ca loolwsd: Fix incorrect WOPI PutFile path in logs
Change-Id: I90f0cd249b1b32593e16801a3c78daa128aa6d71
2016-06-28 12:11:25 +05:30
Ashod Nakashian
b7e0766fea loolwsd: removed lo_jail_subpath
Really unused setting that caused deployment complications.

Change-Id: If837fca4c904e82b23babd4a1f0f3f15b5ef57f4
Reviewed-on: https://gerrit.libreoffice.org/26705
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-06-27 12:29:55 +00:00
Andras Timar
6620502229 loolwsd: fix run_valgrind target with new command line options 2016-06-27 09:45:29 +02:00
Andras Timar
f540fb087c loolwsd: document new command line options in READMEs 2016-06-27 09:41:41 +02:00
Andras Timar
93e1104505 loolwsd: use the new command line options in spec file for default admin 2016-06-27 09:27:25 +02:00
Andras Timar
c3db6d719e reserve version 2.0.0 for actual release... 2016-06-27 09:20:09 +02:00
Andras Timar
e85179e0f8 loolwsd: let loolwsd.service use the new command line options 2016-06-27 09:15:40 +02:00
Andras Timar
8b07403629 loolwsd: use LOOLWSD_CONFIGDIR and LOOLWSD_CACHEDIR in default config 2016-06-27 07:37:04 +02:00
Ashod Nakashian
e8cd9e35d3 bccu#1909 - loolwsd command line options vs. config file and package upgrades
Unit tests updated with new command-line arguments.

Change-Id: I1a391255c44d4d22b8304129634ef7d16b606bce
Reviewed-on: https://gerrit.libreoffice.org/26683
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-06-26 20:45:12 +00:00
Ashod Nakashian
d281813c06 bccu#1909 - loolwsd command line options vs. config file and package upgrades
Removed admin-console creds and allow-local-storage.

Change-Id: If281b6320caee5d28007063591325eb98ba8e01b
Reviewed-on: https://gerrit.libreoffice.org/26670
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-06-26 00:31:00 +00:00
Ashod Nakashian
6501a21114 bccu#1909 - loolwsd command line options vs. config file and package upgrades
Remove command-line arguments in favor of the config file.

Settings can be overridden using the command-line flag
--override (or --o) followed by the full XML path=value.

Change-Id: I902a145f4d2bd0256e31a3e70b0382c0261aecc8
Reviewed-on: https://gerrit.libreoffice.org/26669
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-06-26 00:29:28 +00:00
Ashod Nakashian
8798943f08 bccu#1909 - loolwsd command line options vs. config file and package upgrades
Support overriding config settings via the command-line.

By using --o:name=value (or --override:name=value) the
setting called 'name' can be replaced by 'value'.

Ex. --o:per_document.max_concurrency=12

The above will override the max_concurrency to 12,
regardless of what the XML has set.

Change-Id: If7ffa5dcdc9ce2a8d1a89c8203b8ba870cb624ac
Reviewed-on: https://gerrit.libreoffice.org/26668
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-06-26 00:27:57 +00:00
Ashod Nakashian
7d4d7f47ac bccu#1909 - loolwsd command line options vs. config file and package upgrades
Default config entries and values are now set before loading
the config file from disk. This ensures that an upgrade
to the server with new config entries will not break the
server when the XML is not upgrade, rather, the server
will fallback to the defaults when it fails to find the
entry in the XML.

This, of course, requires adding new entries to the
default entries every time config entries are changed.

Change-Id: Iac849dc41fc7410a3c9093b0d6e91d96182b86fd
Reviewed-on: https://gerrit.libreoffice.org/26667
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-06-26 00:27:21 +00:00
Ashod Nakashian
0832453649 loolwsd: disable webdav in config and add defaulting comment
Change-Id: Id79263c8a9190d294868249e61c747d1454cddf5
Reviewed-on: https://gerrit.libreoffice.org/26666
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-06-26 00:26:45 +00:00
Pranav Kant
42ebabb3a9 Update bundled headers
Change-Id: Ifa69fec15df328d97d5d2c207dcd47c0d3ff660d
2016-06-22 14:52:07 +05:30
Mike Kaganski
47a17fa8d0 testCloseAfterClose: don't hang on bytes==0 && flags==0
At least in some versions of Poco (namely, 1.7.3),
WebSocketImpl::receiveBytes may return both bytes and flags equal
to zero. It makes the HTTPWSTest::testCloseAfterClose() loop
exit condition to never happen, thus test hangs.

According to WebSoket.h, "A return value of 0 means that the peer
has shut down or closed the connection".
Thus, this modification makes this loop robust.

Change-Id: I5dd4f30936dd8246c966f094f2fdae9a45b89ff9
Reviewed-on: https://gerrit.libreoffice.org/26547
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-06-21 23:07:35 +00:00
Pranav Kant
8bba9da761 Make new version string as a JSON string
... easy to differentiate on client side among various version
info parts, especially for LOKit version information.

Change-Id: I4ba18c60367fb9166462b535bc46953a82a8435d
2016-06-21 22:12:48 +05:30
Andras Timar
bc4633a2a1 loolwsd: avoid NotFoundException when per_document.max_concurrency is missing (old config) 2016-06-21 16:15:53 +02:00
Pranav Kant
31009fa9c1 loolwsd: Handle document URIs with spaces
DocumentBroker stores encoded docKey, when child answers with
dockey in its query params, Poco::URI::getQueryParameter gives
decoded docKey -> mismatch -> document load failed.

Change-Id: I53d7cf9d932b9193f15f56ec74db24e279cf3b94
2016-06-21 16:06:12 +05:30
Pranav Kant
b83ac269fa loolwsd: Send LOKit version information to clients
Send as a response to 'loolclient' message received from the
client

Change-Id: I3d33f9fd087489aa9bf5a94f591ab04e208cbf13
2016-06-21 00:30:36 +05:30
Pranav Kant
e271995ed2 loolwsd: Restructure version information functions
... so that version information can be sent to clients.

Change-Id: Icc90f31fabb501f816ff1dca0c618a73660c88bc
2016-06-21 00:29:41 +05:30
Ashod Nakashian
d1d9ec6168 loolwsd: max_concurrency setting added
Change-Id: Iae3789d26ed2e1aba3806a6f99511fa6c7097988
Reviewed-on: https://gerrit.libreoffice.org/26449
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-06-17 23:59:47 +00:00
Ashod Nakashian
bf66f7a908 loolwsd: Calc tile rendering test with editing
Change-Id: Ib02a079bf1e4e90c7dfb65b6038b3ca1423a673c
Reviewed-on: https://gerrit.libreoffice.org/26448
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-06-17 23:56:26 +00:00
Miklos Vajna
5e1b210891 Util: pass by const ref 2016-06-17 09:18:26 +02:00
Miklos Vajna
75db2dd33b loolwsd: disable unit-fonts for now as it's unstable 2016-06-16 13:45:20 +02:00
Miklos Vajna
3c32bc1724 LOOLKit: fix loss of callback during initializeForRendering()
Impress deletes the current view and creates a new one during that call,
so make sure at the end our registered callback is not lost. With this,
the order matches how it's done in gtktiledviewer.

This fixes the HTTPWSTest::testInsertDelete() test when per-view
callbacks are enabled.

Also remove the assert from TileCacheTests::testTileInvalidateWriter()
that would assume something is invalidated right after load: the hope is
that it's possible to load a document without invalidating anything...
:-)
2016-06-16 12:15:11 +02:00