Commit graph

166 commits

Author SHA1 Message Date
Tor Lillqvist
8367df707b Actually do what the comment says
Poco::Timestamp::fromEpochTime() is a static member function that
returns a Timestamp.

Let's hope this doesn't introduce any regression.

Change-Id: I0997c4c3128ec07d5db76dbf3ecc388cd19ac2ac
2016-12-19 12:34:20 +02:00
Ashod Nakashian
58d679240c loolwsd: better MessagePayload encapsulation and cleanup
Change-Id: I690f1044f75582b6e7f05b2026f96a0720be2cbc
Reviewed-on: https://gerrit.libreoffice.org/32156
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-12-19 05:50:30 +00:00
Tor Lillqvist
36f3dece7c Bluntly close sessions that have been idle for more than an hour
By that time the loleaflet code has already done the greying-out (this
happens at the latest after 10 minutes of inactivity) and marked them
as 'inactive'. Bluntly closing the session seems to work out fine, no
new horribly alarming message is displayed by the loleaflet code in
addition to the already visible 'Inactive document ...' one.

Change-Id: I420f0d7530194e6c8d6f34d7985ab810cde5a76a
2016-12-14 18:24:38 +02:00
Ashod Nakashian
fe38e0e1e6 loolwsd: per-socket dedicated sending thread
To avoid degrading performance for everyone
because of a single slow/bad connection, we
send data to clients each in its own thread.

Change-Id: I6f980c25a404c4d05bcdb1979849ea3d2776c7b9
Reviewed-on: https://gerrit.libreoffice.org/31984
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-12-14 04:21:20 +00:00
Pranav Kant
b914aa4222 wsd: If Disabled, turn their corresponding Hide options on
loleaflet will then automatically hide these options from the UI

Change-Id: I65a320850a35b5af4291d896d5942dddfaaa0c98
2016-12-13 18:03:37 +05:30
Pranav Kant
a76825728e Pass Disable{Print,Export,Copy} options to client and handle them
Change-Id: I59a9432bbdd06d8b184f96882c5f4009fcd0be54
2016-12-13 17:59:02 +05:30
Pranav Kant
3e2a9df6dd wsd: Store wopifileinfo separately per client session
Client needs to act accordingly as per permissions/settings set
by the WOPI host.

Change-Id: I7c9f311be50d4aff2562da0cfef2fff889f111d0
2016-12-13 17:45:16 +05:30
Ashod Nakashian
3ac620fc4f loolwsd: alert all users via SenderQueue
Change-Id: Ib5f4e456109a2a48f29fb6b7b75950315490c352
Reviewed-on: https://gerrit.libreoffice.org/31890
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-12-12 05:28:54 +00:00
Ashod Nakashian
da97e2ac18 loolwsd: grow the SenderThreadPool dynamically
The pool is checked for expansion before processing
items from the queue. By tracking the number of idle
thread (i.e. not currently sending data) we ensure
that there is at least one idle thread before
we invoke the socket.

If there is not enough idle threads at that point,
a new thread is spawned, so long as we're below the
limit. This guarantees that even if all the active
threads block on the socket, we'd always have one
more to process new data (until we reach the limit,
which is as many client connections as we have).

Technically, a single slow connection could
still monopolize all connections if there are
many messages to be sent to it. For that we'd
need to track and assign one thread per connection,
something we don't currently do.

Change-Id: Ic8b5e064da068b37bcfa773005495b198763c31d
Reviewed-on: https://gerrit.libreoffice.org/31886
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-12-12 05:24:11 +00:00
Ashod Nakashian
233cb94eff loolwsd: SenderQueue to hold messages to send to clients
This adds SenderQueue and a wrapper of messages to
send back to clients.

Currently no threading takes place, but the messages
are pumped through the queue nonetheless.

Change-Id: Id9997539c0a2a351cbf406f649c268dd3643e88e
Reviewed-on: https://gerrit.libreoffice.org/31883
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-12-12 05:19:04 +00:00
Ashod Nakashian
9252477353 loolwsd: correct logging
Change-Id: I1856b68f336bc5515c1ef82b47893649510438c5
Reviewed-on: https://gerrit.libreoffice.org/31882
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-12-12 00:29:11 +00:00
Tor Lillqvist
e221388c79 Add an 'Idle time' column to the Admin console
Use a new protocol message, 'resetidle' to inform Admin clients
whenever a user has done anything in a document view. This is a
message that Admin clients need to subscribe to.

Also add the current idle time for each document to the 'documents'
message.

To reduce protocol chatter, the idle time is updated at most once per
10 s.

Change-Id: I418e82b05048a3628f21dcd240ccd974b3a01356
Reviewed-on: https://gerrit.libreoffice.org/31653
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Tor Lillqvist <tml@collabora.com>
2016-12-08 08:39:11 +00:00
Pranav Kant
68339f4673 wsd: 'perm: readonly' is already sent in ClientSession::setReadOnly
Change-Id: If8cb509f72539296dbfd816587df2674e82e1e60
2016-12-05 21:28:52 +05:30
Ashod Nakashian
b8c9163ac8 loolwsd: combine tiles strictly in the same row only
Change-Id: I1d2ba647deac8da749e7cf7b56a1c9a19fe840f8
Reviewed-on: https://gerrit.libreoffice.org/31299
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-28 05:27:55 +00:00
Michael Meeks
c1a398977f Adapt makefiles, includes etc. to new locations. 2016-11-25 09:58:57 +00:00
Michael Meeks
cca657c8f2 Apply the pre-branch rename script to re-organize the source. 2016-11-25 09:58:48 +00:00
Renamed from loolwsd/DocumentBroker.cpp (Browse further)