Commit graph

2159 commits

Author SHA1 Message Date
Tor Lillqvist
194b662b54 Don't truncate response in logging
There is no \r there any more, just a \n.
2016-04-04 10:36:34 +03:00
Tor Lillqvist
f7c213c87e Bin leftover from benchmark code
It died in c118987dc6.
2016-04-04 10:32:56 +03:00
Tor Lillqvist
d262f43b93 ClientPortNumber here can never differ from DEFAULT_CLIENT_PORT_NUMBER
So just use DEFAULT_CLIENT_PORT_NUMBER and don't confusingly include
ChildProcessSession.hpp in the test program sources just to define a
static (file-local) ClientPortNumber variable that never gets set to
anything except its initialized value. ChildProcessSession is specific
to the internals of loolwsd and loolbroker and should not be used in
the test programs.
2016-04-04 10:13:16 +03:00
Tor Lillqvist
d137653db5 Avoid over-engineering: Insert Capabilities.hpp in the only file where used 2016-04-04 10:05:30 +03:00
Miklos Vajna
802c702221 loolwsd: fix -Werror,-Wshadow 2016-04-04 09:02:05 +02:00
Tor Lillqvist
9ec0ae58a4 These can be static 2016-04-04 09:45:21 +03:00
Tor Lillqvist
957788a6e1 Define FIFO_ADMIN_NOTIFY in only one place 2016-04-04 09:43:29 +03:00
Tor Lillqvist
01be515760 Include only what you use 2016-04-04 09:36:27 +03:00
Tor Lillqvist
b6419ee915 Include only what you use 2016-04-04 09:31:52 +03:00
Tor Lillqvist
c2370c56ef Use 'using' consistenly 2016-04-04 09:31:03 +03:00
Tor Lillqvist
8e7196ffa0 Insert LOOLKit.cpp contents into LOOLBroker.cpp
As we don't build a separate loolkit program any more we don't need
LOOLKit.cpp.
2016-04-04 09:23:38 +03:00
Tor Lillqvist
a132e06409 Bin the non-preinit and non-fork code paths
Preiniting LibreOfficeKit and forking kit processes (instead of
spawning) has worked fine for a while, and has been the default way
this works.

No 'loolkit' program gets built any more.
2016-04-04 09:07:59 +03:00
Ashod Nakashian
208612bc10 loolwsd: temporarily disabled convert-to test
Convert-to is broken after re-designing Broker
and simplifying it. Temporarily disabling it
to help `make check` pass until it gets fixed.

Change-Id: Id49f86d8a1a25367233a09b865630ed3a210a4fd
Reviewed-on: https://gerrit.libreoffice.org/23793
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-04 04:09:36 +00:00
Ashod Nakashian
fdd3efaad8 loolwsd: reduced some excessive logs to trace level
Change-Id: I9ffcdf5c3ad5781db93e0e3dd7aa7b137c77b25a
Reviewed-on: https://gerrit.libreoffice.org/23792
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-04 04:09:19 +00:00
Ashod Nakashian
ed1790d7a3 loolwsd: kit destruction improvements
Change-Id: Ia491e5dc85e13eda12bb47690a8d335ad0917468
Reviewed-on: https://gerrit.libreoffice.org/23791
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-04 04:08:53 +00:00
Ashod Nakashian
c118987dc6 loolwsd: Removed Broker <-> Kit pipes
Broker is now just a simple spawn-machine.
It only gets requests from WSD to spawn
new kit instances, which it doesn't even
track.

Once a kit instance is initialized, it
connects to WSD with a control WS.
From there on, it's up to WSD to manage
the kit process.

Also was removed the benchmark logic
since it can no longer function.

Change-Id: I1bf56bc6416c9eadafba637276bbb8b3107e5727
Reviewed-on: https://gerrit.libreoffice.org/23790
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-04 04:08:35 +00:00
Ashod Nakashian
d5e2f64790 loolwsd: WSD <-> Child direct communication
WSD now communicates on a WebSocket directly
with kit processes. ChildProcess encapsulates
kit processes and the control WS, which itself
is owned by DocumentBroker.

Change-Id: Ica209aaa07974739b8e51a14e11325d084e193f6
Reviewed-on: https://gerrit.libreoffice.org/23789
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-04 04:08:01 +00:00
Ashod Nakashian
f4b80e630a loolwsd: consume new child from wsd
And spawn new child instances.

Change-Id: I51886f4645a1c8944ccde2e0fae415afc7c8fc24
Reviewed-on: https://gerrit.libreoffice.org/23788
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-04 04:07:27 +00:00
Ashod Nakashian
25a68bf7e9 loolwsd: support for child control WS
Change-Id: Id82009a6d5a20eeff9a7b5c628ec719845e7769e
Reviewed-on: https://gerrit.libreoffice.org/23787
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-04 04:07:10 +00:00
Ashod Nakashian
4be24759f3 loolwsd: SocketProcessor takes HTTPResponse and not HTTPServerResponse
Change-Id: I8a6e1468bc26b4a81ae13a567fd7331207ac37fc
Reviewed-on: https://gerrit.libreoffice.org/23786
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-04 04:06:42 +00:00
Ashod Nakashian
653da3a409 loolwsd: Document::onLoad is now exception safe
In face of exceptions, the lock was not released
and the condition variable was not signalled,
thereby causing all subsequent views on the
same document to fail loading.

Change-Id: I18d3cefcc74a158facefe1e74a9c802ee048b014
Reviewed-on: https://gerrit.libreoffice.org/23785
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-04 04:06:24 +00:00
Ashod Nakashian
ae8ce06162 loolwsd: removed unnecessary from pipe messages
Change-Id: I5fc310f98764b31fc50f877c28d6076bbb14866f
Reviewed-on: https://gerrit.libreoffice.org/23784
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-04 04:05:46 +00:00
Ashod Nakashian
aacd162673 loolwsd: FIFO_NOTIFY -> FIFO_ADMIN_NOTIFY
Change-Id: Ia42983010b3962ca9228032817c6f9024a74c59f
Reviewed-on: https://gerrit.libreoffice.org/23783
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-04 04:05:31 +00:00
Ashod Nakashian
bcf6ab75b8 loolwsd: statics are PascalCased and other cleanups
Change-Id: I1c7c62eb812d2e727b7256152c0c774350d24b52
Reviewed-on: https://gerrit.libreoffice.org/23782
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-04 04:05:10 +00:00
Ashod Nakashian
8a318c879a loolwsd: merged child command dispatching into a single class and renamed
Change-Id: I894849ea7a6c69c084e922c76468c5e9eb621406
Reviewed-on: https://gerrit.libreoffice.org/23781
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-04 04:04:55 +00:00
Ashod Nakashian
504ffec648 loolwsd: request new child from Broker for convert-to requests
Change-Id: I29ff2a416c04393a2b2875e9ffff429f4e25e4c5
Reviewed-on: https://gerrit.libreoffice.org/23780
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-04 04:04:36 +00:00
Ashod Nakashian
21cdf9d503 loolwsd: removed unused authentication function for now
Change-Id: I8c57adecab03eb186aeacea365f092a71e2e097d
Reviewed-on: https://gerrit.libreoffice.org/23779
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-04 04:04:18 +00:00
Michael Meeks
0a42ab7b81 Remove bogus 10 second sleep.
Change-Id: If44f28fdca37997eca09679bb9865944909ef4f2
Reviewed-on: https://gerrit.libreoffice.org/23778
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-04 04:03:58 +00:00
Michael Meeks
1b25179b25 Use bind mounting to accelerate jail creation.
of the 10k files still linked into the jail; 5700 are from usr/
so bind mount just that directory, also set noatime, ro, and
some other helpful looking options.

Change-Id: I28d2d5cbbdf33fb57ea0f0c0915cb267603ee16d
Reviewed-on: https://gerrit.libreoffice.org/23777
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-04 04:03:37 +00:00
Ashod Nakashian
285026b6f6 loolwsd: removed PipeRunnable thread from Broker and merged it with main
Change-Id: Ie10f046ed230d891eb0647e409756a34a4b146b8
Reviewed-on: https://gerrit.libreoffice.org/23776
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-04 04:03:21 +00:00
Ashod Nakashian
ba7db55353 loolwsd: cosmetics
Change-Id: I6c0c2e088e1e428d45cc56a31e7c1f3b8966dc2b
Reviewed-on: https://gerrit.libreoffice.org/23775
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-04 04:03:07 +00:00
Ashod Nakashian
265210741e loolwsd: removed unused read pipe from ChildProcess
Change-Id: I8307488227bf65a6f6fdd829728cd74722a24f58
Reviewed-on: https://gerrit.libreoffice.org/23774
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-04 04:02:51 +00:00
Michael Meeks
7f13face52 Attempt at loolbroker benchmark mode.
Change-Id: Ia1d7450b1e99686e3c654f427c231fd7e0cf8254
Reviewed-on: https://gerrit.libreoffice.org/23773
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-04 04:02:24 +00:00
Michael Meeks
4d2cd2fff3 More helpful exception debug.
Change-Id: Ibc76f20ba0ff9e015632bff2b7f049d40d49064b
Reviewed-on: https://gerrit.libreoffice.org/23772
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-04 04:01:59 +00:00
Michael Meeks
9266ffc09f Remove apparently un-necessary thread local variable template.
Change-Id: Ia220aff972827a0e49a8dadcdb8f32dcd3eed8c9
Reviewed-on: https://gerrit.libreoffice.org/23771
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-04 04:01:42 +00:00
Michael Meeks
23672ac362 Build jails more sparingly eliding un-necessary directories.
Create directories top-down and not bottom up for more efficiency too.
Skip the sdk (if we have it) - ~20k files, and misc. other
pieces that we don't need; still more to go there.

Change-Id: Iccd9ebac495fba414d268b339ef82a161d98a9ca
Reviewed-on: https://gerrit.libreoffice.org/23770
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-04 04:01:05 +00:00
Ashod Nakashian
ceaefabc91 Revert "loolwsd: replace fifo for socket WSD -> Broker"
This reverts commit 97c8f35ddf.

Since the Broker design has been extremely simplified,
all communication between Broker <-> Kit are gone.
Only a pipe between WSD and Broker remain.

Temporarily reverting this to apply the Broker redesign,
after which this patch can be reviewed and merged.
This will be easier than trying to merge the redesigned
Broker on top of this.

Change-Id: Ia901fad604008654c01841df62e88918adad45e1
Reviewed-on: https://gerrit.libreoffice.org/23769
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-04 04:00:45 +00:00
Henry Castro
97c8f35ddf loolwsd: replace fifo for socket WSD -> Broker 2016-04-03 08:12:10 -04:00
Pranav Kant
2220c9d0d0 loleaflet: Rename filename -> title
Change-Id: Ic65b8e819979e35d684807371c76abca55bd5928
Reviewed-on: https://gerrit.libreoffice.org/23734
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2016-04-01 17:22:16 +00:00
Tor Lillqvist
7a80ca8aa1 Make use of 'using' consistent in this file 2016-04-01 18:57:07 +03:00
Tor Lillqvist
9a874e7cda Catch and ignore FileExceptions when persisting editing tiles
There is nothing that says a client has even requested any tiles, so
there might be none to persist. Don't let an exception thrown by the
DirectoryIterator propagate upwards and cause potential
issues.

Noticed the issue when testing using the 'connect' test program,
giving it input that did not request any tiles.
2016-04-01 18:57:07 +03:00
Tor Lillqvist
593d5d7e08 Actually propagate idle/auto save requests to the kit processes
Had to add a shared pointer to the BasicTileQueue for the session to
the MasterProcessSession object, and restructure the coe a a bit to
allocate BasicTileQueue objects dynamically. Possibly just passing a
reference to a BasicTileQueue in the stack would have worked, but why
risk it?

The actual logic when to do auto / idle save is not quite right still,
did not change that in this commit.
2016-04-01 18:57:07 +03:00
Tor Lillqvist
d379ed2113 Improve logging and orderly shutdown 2016-04-01 18:57:07 +03:00
Tor Lillqvist
9e0a8cc43f These are not overridden in derived classes, no need to be virtual 2016-04-01 18:57:07 +03:00
Tor Lillqvist
e3f8fc41a1 Add 'override' 2016-04-01 18:57:06 +03:00
Tor Lillqvist
6c78a8f633 Typo 2016-04-01 18:57:06 +03:00
Tor Lillqvist
14be412f8f It was PipeRunnable::syncChildren() that wrote "query url" messages to the pipe 2016-04-01 18:57:06 +03:00
Tor Lillqvist
a20344b520 Bin PipeRunnable::syncChildren() which died in cbabd6177d 2016-04-01 18:57:06 +03:00
Andras Timar
324f72d844 Revert "serve loleaflet from apache2, until we solve access control problem"
This reverts commit 21cd9167c4.
2016-04-01 16:31:33 +02:00
Pranav Kant
fcc48022fa Allow leaflet to be served from loolwsd
Change-Id: I0179f07d83e9d640ab82ad2a866ef493fdf9e655
Reviewed-on: https://gerrit.libreoffice.org/23721
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
2016-04-01 13:31:53 +00:00