Commit Graph

27 Commits (246e87fea21d6121fd4bd2daeff8a4f92082477e)

Author SHA1 Message Date
Aron Budea 246e87fea2 wsd: Unconditionally compile support-key-enabled code paths
Signed-off-by: Aron Budea <aron.budea@collabora.com>
Change-Id: Iec477c223f2dc75e0be8b472c8439ca9311d6aae
2024-04-14 01:23:00 +01:00
Michael Meeks 9ba05ccbe6 Reduce C++ requirement.
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: I640230950cabd93bf12c86750f6aa6c95eb05021
2024-04-03 22:38:08 +01:00
Ashod Nakashian 84fd030707 wsd: DocBroker with wopiFileInfo
Change-Id: I32c7be67a191df063f97d3c5d7f20ba2a57256da
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-04-03 14:26:28 +01:00
Ashod Nakashian de985834e2 wsd: simplify DocumentBroker construction
Change-Id: I5e908f0f5aed9146e14175eb79335fe9c80db2f2
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-04-03 14:26:28 +01:00
Ashod Nakashian f38f5edd7d wsd: move overloaded findOrCreateDocBroker to RVS
Change-Id: I6a35a49ef3631769c4c38f8c63f86ce3e51aa695
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-04-03 14:26:28 +01:00
Ashod Nakashian 9148996509 wsd: simplify findOrCreateDocBroker call
Change-Id: I8765b887d6fde34bdbb8ff361af6636d494f2ddd
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-04-03 14:26:28 +01:00
Ashod Nakashian 5880312981 wsd: fix support-key build
Change-Id: Ib59494884333a200d768eec8b829e565f6470e2a
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-03-23 09:47:44 +10:30
Miklos Vajna b14f3fffff cool#8465 clipboard: improve handling of plain text copy, complex case
In case the selection is complex (not simple), we used to just request
HTML, and then the browser converted that to plain text, which has the
downsides already mentioned in commit
7f9de46688 (cool#8465 clipboard: improve
handling of plain text copy, simple case, 2024-03-08).

Steps to support this:

1) Clipboard.js now asks for the text/html,text/plain;charset=utf-8 MIME
   types.

2) wsd: ClientRequestDispatcher::handleClipboardRequest() now maps this
   to DocumentBroker::CLIP_REQUEST_GET_HTML_PLAIN_ONLY

3) ClientSession::handleClipboardRequest() maps this to the HTML+plain
   text MIME type list.

4) kit: ChildSession::getClipboard() is now improved to take a list of
   MIME types, not just 1 or everything.

5) kit: ChildSession::getClipboard() now emits JSON in case not all, but
   multiple MIME types are requested.

6) wsd: ClientSession::postProcessCopyPayload() now knows how to
   postprocess clipboardcontent messages, which may or may not be JSON
   (it's JSON if more formats are requested explicitly, leaving the 1
   format or all format cases unchanged)

7) Control.DownloadProgress.js now handles the case when we get JSON and
   sets the core-provided plain text next to the HTML.

   Leave the handling of non-JSON case in, because this means we can
   copy from an old COOL server to a new one.

Note that this approach has the benefit that once the clipboard marker
is inserted, the length of the text/html format would change, which
means we can't parse the clipboard data till the marker is removed.
Emitting JSON for html+text means adding the marker keeps the ability to
parse the HTML and the plain text part of the clipboard in JS.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I67a1f669e8a638d34cc25a2f288a7b30884b9892
2024-03-20 10:21:59 +01:00
Ashod Nakashian 4dfb7ee312 killpoco: use http::Response for Admin metrics
Change-Id: I86eed98061bdb24d4bca8de452e4d4f925f27e93
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-03-19 20:51:02 -04:00
Ashod Nakashian 7fb6ccf4ee wsd: remove duplicate Server and Date headers
We always create http::Response instances
with these headers. These explicit entries
are vestiges from Poco sockets.

Change-Id: I65c263e95b253e22e4e6deae57fffc5616311c84
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-03-19 20:51:02 -04:00
Ashod Nakashian f034709b69 wsd: include cleanup
Change-Id: I9e63d673b25ac29f8070a81b35e5def96d6a165f
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-03-19 20:51:02 -04:00
Ashod Nakashian 57b7626531 wsd: only ever issue one RVS per request key
If we get an identical request while already
processing an async CheckFileInfo (while
serving cool.html), we shouldn't clobber
the old instance and issue a new one.

Change-Id: Ie6da4ab780d581db74430dedd6d307a4ac2e0a0b
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-03-18 13:47:58 +00:00
Gökay Şatır c127d54919 Send permission parameter to wopi parameters.
Signed-off-by: Gökay Şatır <gokaysatir@gmail.com>
Change-Id: I0a779e7f27196ca987b11a619c9b0ee27a87bb4a
2024-03-16 07:28:30 +03:00
Ashod Nakashian c121488a67 wsd: WopiStorage cleanup
Remove MOBILEAPP directives and create
stub WopiStorage and WOPIFileInfo.

Change-Id: I57cd5a008d625ac53ef23c4bb3872381af35560c
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-03-09 12:37:19 -05:00
Ashod Nakashian 4a3e10e4a9 wsd: reuse CheckFileInfo in WopiProxy
Change-Id: I926b8ad6f9035dda4061e8e1d6065a39e772862a
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-03-09 12:37:19 -05:00
Ashod Nakashian 11422c5340 wsd: move WopiProxy to wopi/
Change-Id: I5ec7bfe1c5295c3d17979dc5aaa2806259c6af9d
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-03-09 12:37:19 -05:00
Ashod Nakashian 2d31aafa11 wsd: fix assertion and better logging
In some cases the WOPISrc is inconsistently
encoded. So now we decode before comparing.

Also, improve related log entries.

Change-Id: Ifd6cca76c91a34761dd0ce8f6d78c3af5d47fd43
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-02-26 18:24:32 -05:00
Ashod Nakashian 84aa1a44e8 wsd: parallel load with cool.html
Support parallel CheckFileInfo upon serving
cool.html. This makes loading documents faster
from the user's perspective by parallelizing
CheckFileInfo and, later, DocBroker creation
and document downloading.

Change-Id: I838a19022517196ee2b459991a542ed9ef323e48
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-02-24 14:09:22 -05:00
Ashod Nakashian 3b6c11b0ce wsd: extract ResourceAccessDetails from cool.html file request
Change-Id: Ia03878fa8d0007f6708cfba8a6363ea9d3bfb35d
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-02-24 14:09:22 -05:00
Ashod Nakashian f76bcaa4b4 wsd: use a single shared_ptr instead of container for RequestVettingStation
Change-Id: I38c496edccf5d6ccc352f06b1c75972913248517
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-02-24 14:09:22 -05:00
Ashod Nakashian 32ba3e34b5 wsd: restructure RequestVettingStation interface
This makes it easier to support even earlier use
of RequestVettingStation, when cool.html is served.

Change-Id: I206f5f593a33806c24c6ed1e126d4cae5500f405
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-02-24 14:09:22 -05:00
Ashod Nakashian 7570dd299c wsd: use RequestVettingStation for async loading
This replaces the synchronous loading logic
with the new asynchronous one.

Change-Id: I20fd7903cffbbd7c524d8051295113439ef75d5b
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-02-24 14:09:22 -05:00
Aron Budea 3b8f3d07f6 Replace Util::startsWith/endsWith w/ C++20 equivalent
Replace a few cases of Util::toString(...), too.

Signed-off-by: Aron Budea <aron.budea@collabora.com>
Change-Id: I53c5dbbdf2f60710e94add9dd137aa9becb7bd3e
2024-02-22 08:08:32 +01:00
Ashod Nakashian 3befdcb3f4 wsd: fix missing CommandControl.hpp include
Change-Id: I362e8f8c0645f51b0d49294edb097dfee22b353e
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-02-21 20:54:26 -05:00
Ashod Nakashian 8d55aab329 wsd: exclude HostUtil from non-mobile apps
It's not used, since no external storage
is supported in the apps.

Change-Id: I5cf765ef3cb38dcb396318f6b9ace56bf4e127a2
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-02-21 20:13:39 -05:00
Ashod Nakashian 0f0830c607 wsd: cosmetics
Change-Id: I53faa395aeaea2ac30da489312acf4c2c4a597af
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-02-21 20:13:39 -05:00
Ashod Nakashian 5a82c36680 wsd: move ClientRequestDispatcher to own file
This moves ClientRequestDispatcher and all
its direct exclusive dependencies to its
own file and adjusts formatting.

No functional changes were performed,
although namespaces were restored and
other minor changes were done for
consistency.

The resulting file is still rather large
at around 2000 lines, but that makes
COOLWSD.cpp smaller by about 30% now.

Change-Id: I59bcd997ad08702ce7029c6791095e75ad9b23b0
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-02-21 20:13:39 -05:00