Commit graph

5395 commits

Author SHA1 Message Date
Ashod Nakashian
b734284b59 wsd: cleanup deflating HTTP responses
Change-Id: Id21bdfcb5d3e04f27b681ee9581a0ed06283d163
Reviewed-on: https://gerrit.libreoffice.org/36058
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-04-04 04:29:23 +00:00
Ashod Nakashian
7ca1f03770 wsd: don't invoke onDisconnect from wrong thread
...and warn if we are in the wrong thread.

This can happen when the socket is not properly
closed from the poll thread and is being destroyed.

Change-Id: I749c09b15d04b49038f7cee6a7a13e8f0145acff
Reviewed-on: https://gerrit.libreoffice.org/36057
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-04-04 04:18:52 +00:00
Ashod Nakashian
26ac978266 wsd: don't close invalid forkit pipe
Change-Id: Ib66df894560ad592a7e90774897cb82b573dc77d
Reviewed-on: https://gerrit.libreoffice.org/36056
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-04-04 04:17:38 +00:00
Ashod Nakashian
762ba09370 wsd: fix SSL initialization/uninitialization error
Valgrind found a number of erroneous data access
during the construction and destruction of SslContext.

Change-Id: Ie5072798a3660ed8acc707ba32ac196fa2d0f8af
Reviewed-on: https://gerrit.libreoffice.org/36055
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-04-04 04:16:53 +00:00
Ashod Nakashian
66a76f644b wsd: enable logging with valgrind
Change-Id: I411f7de3d5764cd25af211f2dc77bf0e290adbc7
Reviewed-on: https://gerrit.libreoffice.org/36054
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-04-04 04:15:53 +00:00
Henry Castro
9c4fbdd7c5 loleaflet: add a permanent overlay text selection of the annotation object
Change-Id: I395f7cec22bf187532130b6755fcae58f51c73d2
2017-04-03 22:46:35 -04:00
Michael Meeks
23bf026a63 old style unit tests: re-direct output to log file & add --verbose. 2017-04-03 21:50:09 +01:00
Michael Meeks
0806986c8c Admin model locking - major cleanup.
Do everything in the Admin Model in the AdminPoll thread.
Everything else can push work there safely through callbacks.
2017-04-03 20:42:31 +01:00
Michael Meeks
94022e90d9 Join threads to force a reasonably sensible shutdown sequence.
ie. actually wait until documents are saved and sessions closed.
2017-04-03 15:21:30 +01:00
Michael Meeks
3e1351ec79 Correct obsolete method name. 2017-04-03 15:21:17 +01:00
Andras Timar
bb332a9b97 new SSL key and cert for testing
Change-Id: I9446bfc7905e5980de6aaa36ca72f206e2c558a2
2017-04-03 14:16:19 +02:00
Jan Holesovsky
6c25b36022 Re-introduce the Save button back to the comment creation.
Change-Id: I9e45051f2e867a0af8ab5aab2eb244d4f3449761
2017-04-03 12:04:50 +02:00
Jan Holesovsky
a9389687a4 Don't try to clean up after a runtime error.
We don't know in what state we are...

Change-Id: I8d144000ba684ca23ff67977959c95b31de34367
2017-04-03 11:39:09 +02:00
Ashod Nakashian
8932a1e92e wsd: remove LOOL_CHECK_THREADS
isCorrectThread now always checks
with ENABLE_DEBUG.

Change-Id: I2b5747f3ab18c8ebdbc92e7ffc86a2469b8c7d13
Reviewed-on: https://gerrit.libreoffice.org/36038
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-04-03 05:18:53 +00:00
Ashod Nakashian
95d51493aa wsd: remove nextmessage
This was a workaround to Poco's limitation
of requiring socket receiveFrame be given
preallocated buffer, which couldn't be
exceeded by a larger payload. This meant
the receiver had to know the maximum
payload in advance.

Since only the Kit uses Poco sockets,
and the Kit never receives large payloads,
this preamble is now obsolete.

100% (94/94) of old-style tests PASS.

Change-Id: I76776f89497409e5755e335a3e25553e91cf0876
Reviewed-on: https://gerrit.libreoffice.org/36037
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-04-03 05:18:09 +00:00
Ashod Nakashian
b52a8ac6e2 wsd: const correctness and avoid unnecessary shared_ptr promotion
Change-Id: I4352d82e7b5c6873837e73ec04d894dce9a716b7
Reviewed-on: https://gerrit.libreoffice.org/36036
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-04-03 05:16:49 +00:00
Ashod Nakashian
78d1cc4ac5 wsd: process callbacks before poll handlers
Callbacks are used to initialize handlers,
as is the case with addSession on DocumentBroker.

If the socket gets data before the callback is
invoked, the handler will fail since the expected
initialization hasn't happened yet.

This race indeed happens (rarely) with addSession.

100% (94/94) of old-style tests PASS.

Change-Id: Id9b4f63b45c5564add252e1671b7b0b08aff8150
Reviewed-on: https://gerrit.libreoffice.org/36035
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-04-03 05:16:05 +00:00
Ashod Nakashian
c81db87235 wsd: do child housekeeping on finishing DocBroker thread
Change-Id: I109737b79759986cb2a1cbfc6d711ee2f19ff59d
Reviewed-on: https://gerrit.libreoffice.org/36034
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-04-03 05:15:37 +00:00
Ashod Nakashian
6e596d11f3 wsd: catch exceptions from callbacks and wakup hook
Change-Id: Ib4579a34c91cfe43e5bd7038b175175a9ab0036a
Reviewed-on: https://gerrit.libreoffice.org/36033
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-04-03 05:14:58 +00:00
Ashod Nakashian
d7858b08b9 wsd: fix race in setting SocketPoll owner thread id
Change-Id: Idace925ab02425ed66ac07efc22ab933d229d42e
Reviewed-on: https://gerrit.libreoffice.org/36032
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-04-03 05:14:23 +00:00
Ashod Nakashian
bd82bf4c4b wsd: set DocBroker poll thread once
Change-Id: Ic6397893b2b9b04c6715c393c3f176785b1e2b77
Reviewed-on: https://gerrit.libreoffice.org/36031
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-04-03 05:13:37 +00:00
Ashod Nakashian
d6577654bd wsd: initialization and logging
Change-Id: Icd82a966b94875a65ddb3817c88a3c4c7bedd4ff
Reviewed-on: https://gerrit.libreoffice.org/36030
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-04-03 05:13:14 +00:00
Ashod Nakashian
e0822f8516 wsd: better thread affinity logging
Change-Id: I9e4bc3fe864aa409dc4874a9d6fc4ab22bfea592
Reviewed-on: https://gerrit.libreoffice.org/36029
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-04-03 05:11:57 +00:00
Ashod Nakashian
c9365ad679 wsd: log the DocBroker ID in the Kit as well
This matches the document between WSD and kit,
making logs much easier to read.

Change-Id: If55a9eb84b4a22d2dc4dd53f5f6ab322ebc3646e
Reviewed-on: https://gerrit.libreoffice.org/36028
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-04-03 05:11:23 +00:00
Ashod Nakashian
9936ac1869 wsd: fix alertAllUsers test
Issue the fake disk space error
only after fully loading the doc.

This prevents handling the error
while loading, which terminates
the session.

Change-Id: I5acd9454b1aa9fb5d1f886fb23a76a2d808d4852
Reviewed-on: https://gerrit.libreoffice.org/36027
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-04-03 05:10:51 +00:00
Ashod Nakashian
63ab3bcfa4 wsd: remove queueSession and simplify session loading
Change-Id: Ia03a4ed64b743da8fa7e27de853623126698b9c0
Reviewed-on: https://gerrit.libreoffice.org/36016
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-04-02 04:47:51 +00:00
Michael Meeks
aeb204fb14 Kill race during DocumentBroker shutdown over child process.
==20033== Invalid read of size 4
==20033==    at 0x466504: ChildProcess::close(bool) (DocumentBroker.hpp:111)
==20033==    by 0x44EA28: DocumentBroker::terminateChild(std::string const&, bool) (DocumentBroker.cpp:1313)
==20033==    by 0x45F70E: DocumentBroker::pollThread() (DocumentBroker.cpp:264)
==20033==    by 0x504B2F: SocketPoll::pollingThreadEntry() (Socket.hpp:486)
==20033==    by 0x7310E6F: execute_native_thread_routine (thread.cc:84)
==20033==    by 0x7AF60A3: start_thread (pthread_create.c:309)
==20033==    by 0x7DF002C: clone (clone.S:111)
==20033==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
2017-03-31 17:28:20 +01:00
Michael Meeks
2bca560feb Add hook for disk space check. 2017-03-31 17:18:41 +01:00
Michael Meeks
b9f18e63a3 UnitStorage - first cut at restoring this. 2017-03-31 17:06:47 +01:00
Michael Meeks
68bbd40bdc UnitTimeout: repair unit test timeout fidelity. 2017-03-31 16:00:32 +01:00
Michael Meeks
b70b171304 Tests: enable tilecache test and bin socket buffer size test. 2017-03-31 15:55:14 +01:00
Michael Meeks
ca24df225e Prefork children correctly on start, rather than after a delay. 2017-03-31 15:47:50 +01:00
Pranav Kant
2bd1dd9646 loleaflet: There's another socket object inside
Change-Id: I952b548e11b2456e3c9d64182444377190062b89
2017-03-31 19:58:51 +05:30
Michael Meeks
194c169f68 Remove obsolete write-lock.
The lock was used incompletely & inconsistently, and we should
always and only ever write in the associated SocketPoll's thread.
2017-03-31 14:58:37 +01:00
Marco Cecchetti
1e24c77c82 Loleaflet - Calc: horizontal scroll bar not updated on changed doc width
For big spreadsheet (> 100k rows) when the doc width is extended the
horizontal scroll-bar is not updated, causing to not be able toscroll
the document up to the whole width.

This was due to the fact that the old doc height was obtained through
L.DomUtil.getStyle, but the precision of the retrieved value is 6
digits only.

Change-Id: I430b08dd4c864cec09b62c61420414ad306da225
2017-03-31 14:44:04 +02:00
Pranav Kant
ca8bc37657 loleaflet: Close mobile-mode menu upon clicking any menuitem
Change-Id: Iaea20a9b364fc9f1b10d95694aa9b7e465249ca1
2017-03-31 17:45:26 +05:30
Michael Meeks
e79c5f9083 Use process name for a thread if no name is set (yet). 2017-03-31 11:21:35 +01:00
Pranav Kant
453a452ff9 Makefile: Simplify and link zlib properly
Without this, online doesn't link, atleast for me. The problem seems to
be because in presence of target specific _LDFLAGS, AM_LDFLAGS is
ignored and it is only the latter where we are specifying ZLIB_LIBS.

Further, since the LDFLAGS values are same for all targets, we can
simplify here and rather use AM_LDFLAGS and remove all target specific
LDFLAGS.

Change-Id: I2f1c30c7f34b32c638a4ac60fab709b32f1e6c9a
Reviewed-on: https://gerrit.libreoffice.org/35959
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2017-03-31 09:17:56 +00:00
Pranav Kant
4b7904036a loleaflet: Annotate readonly users in userlist
Change-Id: Ia000a06baf9f88830dd30c4c4a4297eb10192fd6
2017-03-31 12:22:39 +05:30
Pranav Kant
bc98231119 loleaflet: Store and hide readonly view cursors
Change-Id: Ib2bec3158275e77d883308e25f1984491309234f
2017-03-31 12:20:43 +05:30
Pranav Kant
ce1084b74f wsd: Send readonly info to clients
With this every other client would be able to know about other client's
permission i.e whether they have opened the document as readonly. This
could be important eg: to hide the cursor overlay of readonly users in
the UI or to mark these users as readonly in the userlist.

Change-Id: I5dcb1b4e5a22c9b546d16b69b9216cc7653cff04
2017-03-31 12:20:09 +05:30
Andras Timar
ec5fb2a794 add missing default config values
Change-Id: Ic7829c8f97f43bf8f4f2ba4eccdbdf1da89665e4
2017-03-31 07:51:43 +02:00
Pranav Kant
30c9414d6d loleaflet: Context menu cut/copy/paste is always internal
If user wants to take something out of the document, he/she needs to
make use of keyboard shortcuts to do the same.

Change-Id: Id8237e0bfcb311d1a1465645042f160f7e1d8fb6
2017-03-31 11:07:27 +05:30
Michael Meeks
f20e931b29 Re-enable UnitPrefork. 2017-03-30 21:59:05 +01:00
Michael Meeks
a2398fc367 Improve debugging information. 2017-03-30 21:59:05 +01:00
Michael Meeks
eab89a0e70 Fix unit test delay time check. 2017-03-30 21:59:05 +01:00
Henry Castro
1cc621f2af test: remove duplicate common/Util.cpp
Change-Id: I65cfd6a0460a09f7ed3708082127a2ff939e7622
2017-03-30 15:37:21 -04:00
Michael Meeks
ae0dba1088 Cleanup prctl / gettid system-call thrash on logging.
Makes the strace look much prettier.
2017-03-30 18:14:40 +01:00
Michael Meeks
913c469aa8 Cleanup whitespace, return is not a function. 2017-03-30 17:34:52 +01:00
Pranav Kant
1507560e11 tdf#106842: Document DisableCopy mode
Change-Id: I4c9efc5a9a32b4eea8cc751fce418c85d9fa4f35
2017-03-30 18:49:02 +05:30