Commit graph

25 commits

Author SHA1 Message Date
Ashod Nakashian
3f3c1bfae9 loolwsd: move configuration boilerplate
...and restored SSL file names temporarily.

Change-Id: I3195fcb888dc282723996321ceefb17088b593d2
Reviewed-on: https://gerrit.libreoffice.org/23468
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-23 12:12:15 +00:00
Ashod Nakashian
b4e4ccb666 loolwsd: configuration support
Configuration XML is added with SSL as sample use-case.

A 'desc' attribute can be used to describe the fields,
and another 'type' to help define the corresponding data
type in the code.

Since Poco allows accessing group nodes (that have the
same name) by index, order can be preserved.

SSL initialization refactored and cert/key file
paths moved to the config file.

Change-Id: I259826a19697bd851587bebcc4f0cd233ab6848b
Reviewed-on: https://gerrit.libreoffice.org/23464
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-23 11:28:14 +00:00
Pranav Kant
7f371958ae SSL everywhere
Use same port (9989) for all client connections. This includes
admin panel, static file serving and normal client websocket
connections.

Change-Id: Idcfd7dd8925523c36e884717c41a3b6a827f6ff3
2016-03-22 00:05:29 +05:30
Pranav Kant
4dd14c0024 loolwsd: SSL infrastructure
... and use SSL for client connections. Also fix our test suite
to use HTTPS now.

Change-Id: Id396a7c2d1830da8d3b0ce446522403363ac17c1
Reviewed-on: https://gerrit.libreoffice.org/23395
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Tor Lillqvist <tml@collabora.com>
2016-03-22 00:05:26 +05:30
Tor Lillqvist
9a66e75e83 Revert "loolwsd: SSL infrastructure"
This reverts commit fb9c9a9ec7.
2016-03-21 16:52:55 +02:00
Pranav Kant
fb9c9a9ec7 loolwsd: SSL infrastructure
... and use SSL for client connections.

Change-Id: Id396a7c2d1830da8d3b0ce446522403363ac17c1
Reviewed-on: https://gerrit.libreoffice.org/23395
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Tor Lillqvist <tml@collabora.com>
2016-03-21 14:05:10 +00:00
Henry Castro
8a2bd1127b loolwsd: WOPI, handle request discovery 2016-03-15 11:35:59 -04:00
Ashod Nakashian
1268507bf0 loolwsd: child WS URL format changed
The current format is more flexible and standard.

/loolwsd/child?sessionId=xxx&jailId=yyy

The sessionId is the client-specific connection ID (which
 is originally passed to the child via the Broker.

The jailId is the PID of the child.

Change-Id: I69c88e84114f9678addf795896ca2da15ca1221b
Reviewed-on: https://gerrit.libreoffice.org/23211
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-14 03:05:38 +00:00
Ashod Nakashian
7aeeab46f8 loolwsd: Admin manager added with a sample stats command
Change-Id: I7d3c1a5ab573d20d285c1c184cfb88ace17991f8
Reviewed-on: https://gerrit.libreoffice.org/22430
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-02-17 15:30:02 +00:00
Pranav Kant
7ffd4b45db bccu#1468: handle 'nextmessage:' in prisoner -> master text frames
There are cases when prisoner would send huge text data but
without preceeding 'nextmessage' frames making the master throw
WebSocketException.

Also move the 'nextmessage' frame interpretation logic up in the
'else if' ladder to be able to detect and handle such huge text frames.

Change-Id: Ibe44b69f4ab75c1b8096648c6006316c88366e7c
Reviewed-on: https://gerrit.libreoffice.org/21835
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-02-01 05:09:35 +00:00
Ashod Nakashian
6f5afd92ba loolwsd: fixed server thread-pool
TCPServer doesn't use the custom ThreadPool passed to it
to dispatch connections. This leads to starvation
when too many connections are initiated together.

Because we open an internal socket back to master, we
need to be able to dispatch two connections (two threads)
for each client connection.

Therefore, the default ThreadPool needs to have sufficient
capacity to grow. A new constant is added to define this
capacity and it is used to configure both the TCPServer
(which configures the default ThreadPool) and the customer
ThreadPool (used to host the actuall connection handler).

Change-Id: I49adc039aa99e9350b0defc4a5e141b77524992e
Reviewed-on: https://gerrit.libreoffice.org/21976
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-02-01 05:06:35 +00:00
Ashod Nakashian
9593ec5720 loolwsd: improved polling and pong with client
Change-Id: I17c4f7685d23b6e4c84a7f8b34fcb7dbcaf959f9
Reviewed-on: https://gerrit.libreoffice.org/21754
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-24 21:02:16 +00:00
Ashod Nakashian
d2bde985cc loolwsd: poll timeout of 500ms and handling priority events
Change-Id: Iadf449ee62700e1ac5da2be8c73c674657633808
Reviewed-on: https://gerrit.libreoffice.org/21679
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-21 16:02:04 +00:00
Ashod Nakashian
6b24eb7bba loolwsd: PIPE_BUFFER -> READ_BUFFER_SIZE = 2048
Change-Id: I12e9725549a15b2cb1c287db9de0fca732dafac2
Reviewed-on: https://gerrit.libreoffice.org/21678
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-21 15:59:47 +00:00
Ashod Nakashian
0632da5edb loolwsd: reworked child management and load balancing in broker
Change-Id: I92874d1aeb8fe46f3bbc1cb9d3b2b9d46632f4b9
Reviewed-on: https://gerrit.libreoffice.org/21473
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-14 13:56:40 +00:00
Ashod Nakashian
5bf75f56ca loolwsd: centralized signal handling and eased debugging
Change-Id: Ifdb3e2bca540bec3c6dea1ab24173c8ea0267706
Reviewed-on: https://gerrit.libreoffice.org/21325
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-11 04:06:56 +00:00
Henry Castro
f3c8ace597 loolwsd: request abnormal termination 2016-01-09 12:26:04 -04:00
Ashod Nakashian
7f9485e318 loolwsd: jailId now static member
Change-Id: I7142038d421d642a3e9dfd3e1069c7401ec7db5c
Reviewed-on: https://gerrit.libreoffice.org/21183
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-07 05:56:25 +00:00
Ashod Nakashian
900c344a7e loolwsd: refactored JailedDocumentRoot path
Change-Id: Ibee16e6ebde0ae1945be53903a0b0bad4f3300ed
Reviewed-on: https://gerrit.libreoffice.org/21179
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-07 05:53:39 +00:00
Ashod Nakashian
cf65588031 loolwsd: more local ClientPortNumber
Change-Id: I2ce649a8f880bd0ec3bded715b1d8864e176b935
Reviewed-on: https://gerrit.libreoffice.org/21178
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-07 05:52:24 +00:00
Ashod Nakashian
0869cace37 loolwsd: consolidated TerminationFlag
Change-Id: Ic06b940f3b48888e4f398816e5ee45c0f49046e3
Reviewed-on: https://gerrit.libreoffice.org/21059
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-03 15:15:46 +00:00
Henry Castro
cc1861a6a8 loolwsd: define a constant pipe buffer size 2015-12-30 21:01:07 -04:00
Ashod Nakashian
88b76fe9d4 loolwsd: removed dead code
Variables and options lingering from previous iterations removed.
Standardizing static member names.
Header inclusion cleanups.

Change-Id: I65182ad4d100e0077f1b450be50cf95d7b8f0fc7
Reviewed-on: https://gerrit.libreoffice.org/20997
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2015-12-28 23:36:55 +00:00
Ashod Nakashian
b2d124af93 loolwsd: proper handling of non-default client port number
Change-Id: I388f0ce0252c5f7889e77c4d85b4cf21d4a222b6
Reviewed-on: https://gerrit.libreoffice.org/20979
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2015-12-28 04:12:15 +00:00
Ashod Nakashian
d273057488 loolwsd: moved config values into common header
Change-Id: Ib88379e453f207a6a5e6223045a393c769082be4
Reviewed-on: https://gerrit.libreoffice.org/20978
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2015-12-28 04:09:50 +00:00