Commit graph

4081 commits

Author SHA1 Message Date
Jan Holesovsky
66053621bd Make sure we resize the payload to the amount of read bytes.
Change-Id: I33f032182912b4f03d073258c91974518db327fd
2016-11-08 14:54:15 +01:00
Andras Timar
127b39d5b6 fix l10n of word count (thousand separator!) 2016-11-08 14:25:18 +01:00
Ashod Nakashian
d978dc83cf loolwsd: minor improvement to logging while running tests
Change-Id: Id602e52ceb42923f19d902f653e2d6477b8b8e1f
Reviewed-on: https://gerrit.libreoffice.org/30676
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-08 00:21:53 +00:00
Ashod Nakashian
0164df61a5 loolwsd: alertAllUsersOfDocument must be called while holding lock
Change-Id: I266a61402973c9418eb293d2f66601d00be76754
Reviewed-on: https://gerrit.libreoffice.org/30675
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-08 00:21:37 +00:00
Ashod Nakashian
d8c2bb9195 loolwsd: minimize holding locks beyond the necessary point
Change-Id: I379a649469622682d7ebe98b8a7ebe29eddd1dfa
Reviewed-on: https://gerrit.libreoffice.org/30674
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-08 00:21:18 +00:00
Andras Timar
7b83a5f90b loleaflet: update pot file 2016-11-07 18:52:50 +01:00
Andras Timar
b4dd01a3c8 loleaflet: update uno command translations 2016-11-07 18:51:25 +01:00
Andras Timar
f6a694716c loolwsd: copy 'debian' dir to tarball, silence tar 2016-11-07 15:20:01 +01:00
Pranav Kant
5f9a9264e4 Fix menubar l10n, set String.locale before requiring loleaflet
Change-Id: Ic5a22f05d0a11bd0485d0c88dfa34dcc6bfe29cf
2016-11-07 17:59:42 +05:30
Pranav Kant
9f65377c42 getViewIdHexColor -> getViewIdColor
This doesn't return a hex value anymore, it returns a rgb
integer.

Change-Id: I2fc234d7ba09e7b750c63dd9cf93356d02707fce
2016-11-07 17:31:15 +05:30
Miklos Vajna
121a471203 loolwsd: clean up unused using declarations
Change-Id: Ib7fc0d2dbc10cbccacde327b29fe70f255d58a05
2016-11-07 08:27:19 +01:00
Ashod Nakashian
ea0e5e9344 loolwsd: echo the unit-test command-line before running
Change-Id: Ib061732bccd18112c5d3842c01e8d20d441816c0
Reviewed-on: https://gerrit.libreoffice.org/30647
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-07 06:43:29 +00:00
Ashod Nakashian
2507f7f89c loolwsd: refactor DocumentBroker load and addSession
Change-Id: I01db44561f79280f152bdf802efcbc064b22ab89
Reviewed-on: https://gerrit.libreoffice.org/30646
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-07 06:43:12 +00:00
Ashod Nakashian
f3ffd59860 loolwsd: assert ChildProcess doesn't destroy DocumentBroker
Change-Id: Iff20323f809f255557e05652ba08f7688b823fe1
Reviewed-on: https://gerrit.libreoffice.org/30645
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-07 06:42:40 +00:00
Ashod Nakashian
f669891892 loolwsd: name the child socket thread
Change-Id: I079d821522b016cbd70a958b6a3e908a32b61f37
Reviewed-on: https://gerrit.libreoffice.org/30644
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-07 06:41:22 +00:00
Ashod Nakashian
a1d846b431 loolwsd: correct wsd initialization and preconditions
For unit-tests at least listening to the public port before
having forked forkit, let alone having a single child process
ready, means we could starve and fail tests randomly.

Here we first correct the order of initialization, such that
the public port listening happens last. Second, we wait until
we have at least one child successfully connected and ready.

Change-Id: I7a31ad1ca4b30746f3cbf9c6b315670207cb7716
Reviewed-on: https://gerrit.libreoffice.org/30643
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-07 06:40:43 +00:00
Ashod Nakashian
86fb4dc03b loolwsd: extend the lifetime of lokit to avoid destroying
Lokit's destroy is prone to throw (at least in dbgutil).

This exception brings the binary down with a core-dump.

To avoid this, we extend the lifetime of lokit to the end
of the process, where we invoke std::_Exit to promptly
kill the process and exit.

For reference, the exception is thrown as follows:
 #0  0x00007f0ba5a43bcd in __cxa_throw () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
 #1  0x00007f0b76303248 in (anonymous namespace)::ModuleManager::identify (this=0x7f0b5328e6d0, xModule=empty uno::Reference) at /home/ash/prjx/cp51/framework/source/services/modulemanager.cxx:198
 #2  0x00007f0b762606dc in (anonymous namespace)::JobExecutor::notifyEvent (this=0x7f0b77176b30, aEvent=...) at /home/ash/prjx/cp51/framework/source/jobs/jobexecutor.cxx:274
 #3  0x00007f0ba13ea455 in (anonymous namespace)::SfxGlobalEvents_Impl::implts_notifyJobExecution (this=0x7f0b77176a30, aEvent=...) at /home/ash/prjx/cp51/sfx2/source/notify/globalevents.cxx:397
 #4  0x00007f0ba13e9346 in (anonymous namespace)::SfxGlobalEvents_Impl::documentEventOccured (this=0x7f0b77176a30, _Event=...) at /home/ash/prjx/cp51/sfx2/source/notify/globalevents.cxx:241
 #5  0x00007f0ba0fe5717 in SfxTerminateListener_Impl::notifyTermination (this=0x7f0b772462c8, aEvent=...) at /home/ash/prjx/cp51/sfx2/source/appl/appinit.cxx:125
 #6  0x00007f0b762ebc39 in framework::Desktop::terminate (this=0x7f0b7721d530) at /home/ash/prjx/cp51/framework/source/services/desktop.cxx:330
 #7  0x00007f0ba47940ce in lo_destroy (pThis=0x154de60) at /home/ash/prjx/cp51/desktop/source/lib/init.cxx:2926
 #8  0x0000000000429681 in lok::Office::~Office (this=<optimized out>, __in_chrg=<optimized out>) at LibreOfficeKit.hpp:516
 #9  __gnu_cxx::new_allocator<lok::Office>::destroy<lok::Office> (this=<optimized out>, __p=<optimized out>) at /usr/include/c++/5/ext/new_allocator.h:124
 #10 std::allocator_traits<std::allocator<lok::Office> >::_S_destroy<lok::Office> (__p=<optimized out>, __a=...) at /usr/include/c++/5/bits/alloc_traits.h:285
 #11 std::allocator_traits<std::allocator<lok::Office> >::destroy<lok::Office> (__a=..., __p=<optimized out>) at /usr/include/c++/5/bits/alloc_traits.h:414
 #12 std::_Sp_counted_ptr_inplace<lok::Office, std::allocator<lok::Office>, (__gnu_cxx::_Lock_policy)2>::_M_dispose (this=0xb04f40) at /usr/include/c++/5/bits/shared_ptr_base.h:531
 #13 0x000000000042dfb6 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0xb04f40) at /usr/include/c++/5/bits/shared_ptr_base.h:150
 #14 0x0000000000425797 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count (this=0x7ffce7430468, __in_chrg=<optimized out>) at /usr/include/c++/5/bits/shared_ptr_base.h:659
 #15 std::__shared_ptr<lok::Office, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr (this=0x7ffce7430460, __in_chrg=<optimized out>) at /usr/include/c++/5/bits/shared_ptr_base.h:925
 #16 std::shared_ptr<lok::Office>::~shared_ptr (this=0x7ffce7430460, __in_chrg=<optimized out>) at /usr/include/c++/5/bits/shared_ptr.h:93
 #17 lokit_main (childRoot="/home/ash/prj/lo/online/loolwsd/test/../jails/", sysTemplate="/home/ash/prj/lo/online/loolwsd/test/../systemplate", loTemplate="/home/ash/prj/lo/instdir", loSubPath="lo", noCapabilities=<optimized out>, queryVersion=queryVersion@entry=true, displayVersion=false) at LOOLKit.cpp:1441
 #18 0x000000000041df41 in createLibreOfficeKit (childRoot="/home/ash/prj/lo/online/loolwsd/test/../jails/", sysTemplate="/home/ash/prj/lo/online/loolwsd/test/../systemplate", loTemplate="/home/ash/prj/lo/instdir", loSubPath="lo", queryVersion=queryVersion@entry=true) at LOOLForKit.cpp:228
 #19 0x000000000041aea4 in main (argc=7, argv=0x7ffce7431ec8) at LOOLForKit.cpp:389

194         {
195             throw css::lang::IllegalArgumentException(
196                     OUString("Given module is not a frame nor a window, controller or model."),
197                     static_cast< ::cppu::OWeakObject* >(this),
198                     1);
199         }

Change-Id: Idaef5e0a28021a73f4c03ee3bee80968d9c57bd5
Reviewed-on: https://gerrit.libreoffice.org/30642
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-07 06:39:22 +00:00
Ashod Nakashian
8cd8ca27a6 loolwsd: new 'exit' command to request child process termination
Change-Id: Id3f9bc67096b422630e04f59ed4ccbca012ddd4a
Reviewed-on: https://gerrit.libreoffice.org/30641
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-07 06:38:39 +00:00
Ashod Nakashian
f1f1ff7057 loolwsd: correct document loading and error handling
Change-Id: I7529c8584356f5eea3c91b5d5ffdd6a956710241
Reviewed-on: https://gerrit.libreoffice.org/30640
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-07 06:37:36 +00:00
Ashod Nakashian
71f2f4921d loolwsd: better use named variable than it->second
Change-Id: Ia336b9001911dfd2cf1c19c1536f52bed7684a2a
Reviewed-on: https://gerrit.libreoffice.org/30639
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-07 06:36:52 +00:00
Ashod Nakashian
11a0d016ca loolwsd: inline and simplify connectPeers
Change-Id: I64fbeefa59573eb9e467dc18ecbf75ebd72b3be4
Reviewed-on: https://gerrit.libreoffice.org/30638
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-07 06:36:24 +00:00
Ashod Nakashian
4e13f1b37c loolwsd: cleanup document and storage loading in WSD
Change-Id: I4d6bdda131efb6270fbd5864034ac619cf86ef3d
Reviewed-on: https://gerrit.libreoffice.org/30637
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-07 06:36:04 +00:00
Ashod Nakashian
a5f1597e0f loolwsd: LOOLKit logs updated
Change-Id: I003d060ac2fd5673d57f7c175837ac3daf335f17
Reviewed-on: https://gerrit.libreoffice.org/30636
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-07 06:34:59 +00:00
Ashod Nakashian
e329f3595f loolwsd: UnitStorage logs updated
Change-Id: Ie5e9bed6d6ab56039d357dea09470953ca49d458
Reviewed-on: https://gerrit.libreoffice.org/30635
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-07 06:34:41 +00:00
Ashod Nakashian
10659d970b loolwsd: UnitPrefork logs updated
Change-Id: I7cc37295459aceac6ba38af4fb274c39f55885a4
Reviewed-on: https://gerrit.libreoffice.org/30634
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-07 06:34:31 +00:00
Ashod Nakashian
ca17fc74c7 loolwsd: Unit logs updated
Change-Id: Ic60e59f21bdb426997808d14a4e0375e38362161
Reviewed-on: https://gerrit.libreoffice.org/30633
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-07 06:34:16 +00:00
Ashod Nakashian
9bb6d73fda loolwsd: DocumentBroker logs updated
Change-Id: I64bd10c05a24f1b6716241cf1048af157282fa18
Reviewed-on: https://gerrit.libreoffice.org/30632
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-07 06:33:33 +00:00
Ashod Nakashian
f4c7d67d26 loolwsd: LOOLWSD logs updated
Change-Id: I0a139ed4f27be4949c15949a10d461784aa510e0
Reviewed-on: https://gerrit.libreoffice.org/30631
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-07 06:33:12 +00:00
Ashod Nakashian
f3d5b73c4e loolwsd: sleep more with LOOL_DEBUG after dumping stacktrace
Change-Id: I52d764634af3faa0b08d7c4ff7483e0dcc1db312
Reviewed-on: https://gerrit.libreoffice.org/30630
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-07 06:32:34 +00:00
Ashod Nakashian
800e711321 loolwsd: proper ChildProcess cleanup
Change-Id: If9be827aa50471b7d1d922402414d028ccdcff8b
Reviewed-on: https://gerrit.libreoffice.org/30629
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-07 06:32:10 +00:00
Ashod Nakashian
3993757ee8 loolwsd: fix race while creating new documents
This fixes the race rather than trying to patch it.
It still minimizes the locking necessary to a minimum
to maximize parallelism.

The approach is to have at least the DocBrokers lock
or the DocumentBroker lock (if we already have a doc)
while creating new document views.

Change-Id: I96b4f17b3be3d03cd5e6f4d17d39e2165fe008a7
Reviewed-on: https://gerrit.libreoffice.org/30628
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-07 06:31:26 +00:00
Ashod Nakashian
8b9372d517 loolwsd: improved ChildProcess message handling logs
Change-Id: I28a1de58f4c886d7c6f8c9f723a84e2a8726edc2
Reviewed-on: https://gerrit.libreoffice.org/30625
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-07 06:29:40 +00:00
Ashod Nakashian
52b8a11554 loolwsd: lock -> docBrokersLock
Change-Id: Ia1e1e65003967edf092508211be5f3953239e0f6
Reviewed-on: https://gerrit.libreoffice.org/30627
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-07 06:29:24 +00:00
Ashod Nakashian
0dec678b16 loolwsd: PrisonerSession logs updated
Change-Id: I3cae4d77be1c556abef64e0ced05747ef41ddb23
Reviewed-on: https://gerrit.libreoffice.org/30626
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-07 06:29:11 +00:00
Ashod Nakashian
f63fbef560 loolwsd: ChildSession logs updated
Change-Id: I5675c5b79fc96ab34605b68b0fe05c5fe90e92db
Reviewed-on: https://gerrit.libreoffice.org/30624
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-07 06:28:44 +00:00
Ashod Nakashian
a537acf7d6 loolwsd: add genRandomString and use it to test SaveOnDisconnect
Change-Id: I3e60579032882b921ee7c833a78e8d87e79e1360
Reviewed-on: https://gerrit.libreoffice.org/30623
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-07 06:28:32 +00:00
Ashod Nakashian
f4d72d66e3 loolwsd: move genRandomData to helpers
Change-Id: I1edafb41fefc07e64fa8625d2b88617079a327fa
Reviewed-on: https://gerrit.libreoffice.org/30622
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-07 06:26:22 +00:00
Ashod Nakashian
0305cf4819 loolwsd: more efficient child message forwarding
Change-Id: I60ab308b2f7d108ee9e4f2892fe3dda68f7f3201
Reviewed-on: https://gerrit.libreoffice.org/30621
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-07 06:26:05 +00:00
Ashod Nakashian
fd8b426860 loolwsd: use correct log level and not typo
Change-Id: I71a04714c1ad406d454c3312ffa72930293a94c1
Reviewed-on: https://gerrit.libreoffice.org/30620
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-07 06:25:44 +00:00
Pranav Kant
216d1b6a52 Undefined variable
Change-Id: I0c5a07fa383523053ca7de319fcc9d1acdca63cd
2016-11-07 10:26:32 +05:30
Miklos Vajna
4034006338 getNewChild: avoid multiplication at int precision, then compare with long
Change-Id: I23c26ef9014150fda7e400e19526244ddaa411cf
2016-11-04 14:09:09 +01:00
Ashod Nakashian
871a67bd98 loolwsd: avoid side bookkeeping
Change-Id: I7ad2cbf45c07173447c4e80dcf06f0155de904e9
Reviewed-on: https://gerrit.libreoffice.org/30554
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-04 05:22:07 +00:00
Ashod Nakashian
d17d148880 loolwsd: logging improvements
Change-Id: If291bf20ae59085f2120d4c92a26de6ccddbc98a
Reviewed-on: https://gerrit.libreoffice.org/30553
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-04 05:17:57 +00:00
Ashod Nakashian
b6fae38f17 loolwsd: simplified createSession
Change-Id: I2ebb37cae61d9625731b48ea6b9ce31646ad3e42
Reviewed-on: https://gerrit.libreoffice.org/30552
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-04 05:13:49 +00:00
Ashod Nakashian
61488cce78 loolwsd: move child communication logging
...and simplify the message (new line not needed).

Change-Id: Ic304d39e444b13c140e16dbe232c2cb03659ff99
Reviewed-on: https://gerrit.libreoffice.org/30551
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-04 05:11:43 +00:00
Ashod Nakashian
84fb2d43fb loolwsd: warn if sessions remain by ~DocumentBroker
Change-Id: I03be11b02af7560f934b138e86f8857fd9870a60
Reviewed-on: https://gerrit.libreoffice.org/30550
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-04 05:04:47 +00:00
Ashod Nakashian
159f055a89 loolwsd: Storage logs updated
Change-Id: I1e78371d03c6d5734e60fb843e9f0e9d15db6fa7
Reviewed-on: https://gerrit.libreoffice.org/30549
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-04 05:04:20 +00:00
Ashod Nakashian
b9b69e9534 loolwsd: rename LOG_XXX internal variable to minimize conflicts
Change-Id: I82e98b38a0ac6a5e821148f213aa1b15827e23df
Reviewed-on: https://gerrit.libreoffice.org/30548
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-04 05:02:05 +00:00
Ashod Nakashian
4a74d49780 loolwsd: logs updated
Change-Id: I87ad4979c789ec1933ecdf39bd81dabce95ef9bb
Reviewed-on: https://gerrit.libreoffice.org/30547
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-04 05:01:32 +00:00
Andras Timar
f96ef2c4f3 loleaflet: page orientation in Writer's Format menu 2016-11-03 19:40:27 +01:00