Commit graph

2786 commits

Author SHA1 Message Date
Caolán McNamara
5f1c943a98 add hasWASMSupport to capabilities
so the launching site can query if wasm is enabled to see if it needs to
insert the required headers, so we can then in turn make it optional on
those being set to also require matching headers.

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: Icd73081809abb8098c21bc61a8357869db45ff6c
2023-12-06 09:58:57 +00:00
Rash419
f203a4d68f admin: indirection add new command for sanity check
- routetoken_sanity_check

Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: Ieaabcd044b65ad0620089ae6413e3f626ff68c4c
2023-12-05 10:46:31 +05:30
Hubert Figuière
aa43f7e43b wopi: Added DisableInsertLocalImage
This allow being able to disable pick up of a local image. Handle the UI as well.
To be used with EnableInsertRemoteImage.

Return DisableInsertLocalImage: true as part of the WOPI CheckFileInfo reply
Default value is false (enabled)

Added an 'insertremotegraphic' button to the classic toolbar for use when
it's the only option.

Signed-off-by: Hubert Figuière <hub@collabora.com>
Change-Id: I1925f804433a7bda6025cb65b0943d78927bea15
2023-12-04 20:36:13 +00:00
Michael Meeks
9de0b02e7b Refactor: move tile limit accounting into ClientSession.
Also add state dumping of tile on the fly statistics per session.

Change-Id: I8413cdfd489be3c238738f95d9d5c4aa177ff262
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2023-12-04 17:45:12 +00:00
Miklos Vajna
2659983faa wsd: fix missing session handling in DocumentBroker::forwardToChild()
To reproduce:

	./clientsession_fuzzer -max_len=16384 fuzzer/data/crash-32e5136d2291e6c5fa99aa5942acded42b66a528

Failed with:

    #7 0x7f1aeb9c9cf1 in __assert_fail (/lib64/libc.so.6+0x42cf1) (BuildId: f732026552f6adff988b338e92d466bc81a01c37)
    #8 0x55a9f13968a5 in DocumentBroker::forwardToChild(std::shared_ptr<ClientSession> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool) /home/vmiklos/git/collaboraonline/online-fuzz/wsd/DocumentBroker.cpp:3613:5
    #9 0x55a9f1676a9a in ClientSession::forwardToChild(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::shared_ptr<DocumentBroker> const&) /home/vmiklos/git/collaboraonline/online-fuzz/wsd/ClientSession.cpp:1414:23
    #10 0x55a9f166f96a in ClientSession::_handleInput(char const*, int) /home/vmiklos/git/collaboraonline/online-fuzz/wsd/ClientSession.cpp:1100:20

The reproducer was originally added in commit
aefc65465b (wsd: fix crash when downloadas
has not enough parameters, 2020-02-21), but now it also triggered this
assertion failure problem as well.

The brave assert was added in commit
b2aff3e817 (wsd: pass ClientSession to
forwardToChild, 2022-11-26).

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I4a0adda49aa2d24925d448fa5753509917d2585a
2023-12-04 16:15:16 +00:00
Rash419
d118874bee wsd: fix: failed to load passwordprotected and csv files
- send blockingcommandstatus after document is loaded
- also fix odd nodocloaded dialog

Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: I8f0ae405ffa77b47e09c01caf51ddc4fd5e1d862
2023-12-04 11:23:32 +05:30
Caolán McNamara
c33a372876 wasm attempt to download file that doesn't exist with reverse proxy enabled
Handling request: /wasm/https:%252F%252Fwhatever%252Fnextcloud%252Findex.php%252Fapps%252Frichdocuments%252Fwopi%252Ffiles%252Fwhatever%3Faccess_token=ozxpkBByLTd9XnWaWHdrTVhMp3Exf1mt&access_token_ttl=0| wsd/COOLWSD.cpp:4093
[ websrv_poll ] INF  #22: Starting GET request handler for session [032] on url [https:%252F%252Fwhatever%252Fnextcloud%252Findex.php%252Fapps%252Frichdocuments%252Fwopi%252Ffiles%252Fwhatever%3Faccess_token=ozxpkBByLTd9XnWaWHdrTVhMp3Exf1mt&access_token_ttl=0].| wsd/WopiProxy.cpp:37
[ websrv_poll ] DBG  #22: Getting info for wopi uri [https://whatever/nextcloud/index.php/apps/richdocuments/wopi/files/212272_ocbizrjb36ht?access_token=whatever&access_token_ttl=0]| wsd/WopiProxy.cpp:120
[ websrv_poll ] ERR  Invalid URI [] to http::Session::create| net/HttpRequest.cpp:664

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I8471ee4247ecab62284e06330bd157aa126b9cd8
2023-12-01 21:02:35 +00:00
Miklos Vajna
89f080ba45 wsd: check for nullptr channel in AdminSocketHandler
This can happen like this:

    #8 0x7f14fdf4ec86 in std::terminate() (/usr/lib64/libstdc++.so.6+0xb7c86) (BuildId: c74eca671e2dd0f063706372d103f8acef88f1e3)
    #9 0x7f14fdf4eee7 in __cxa_throw (/usr/lib64/libstdc++.so.6+0xb7ee7) (BuildId: c74eca671e2dd0f063706372d103f8acef88f1e3)
    #10 0x55ddc5b906d2 in Poco::AutoPtr<Poco::Channel>::operator->() /usr/include/Poco/AutoPtr.h:232:4
    #11 0x55ddc5b7eb07 in AdminSocketHandler::handleMessage(std::vector<char, std::allocator<char>> const&) /home/vmiklos/git/collaboraonline/online-fuzz/wsd/Admin.cpp:236:13

Note how LOG_ANY() assumes that Log::logger().getChannel() is not
nullptr (so the caller has to check for it), while the more typical
variants with a log level like LOG_TRC() already do a similar check via
LOG_CONDITIONAL().

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I5e1379f33e6640fd07de673ef0d07b1d4d611c89
2023-12-01 15:35:39 +00:00
Szymon Kłos
a243bc9f49 Add list of allowed data sources
- uses new lok_allow setting to provide such list
- for backward compatibility uses also all post_allow and storage.wopi
  entries
- Used for example in: PostMessage Action_InsertGraphics,
  =WEBSERVICE() function, external reference in the cell

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: Ib930e0119d4ea124b9cd565f6b3683310b1b3ced
2023-12-01 15:25:47 +00:00
Miklos Vajna
dc149702ae doc broker: handle no _storage in uploadToStorageInternal()
Similar to commit eb5c86a4d3
(DocumentBroker::saveToStorage: guard against nullptr _storage,
2020-10-26), with the same input.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I17ac2bc12ba086d16ccbf3d5c758e081a32cbf5a
2023-12-01 09:17:36 +01:00
Rash419
2c78023630 Revert "wsd: disable ctrl+s when HideSaveOption is true"
- fix: disabled 'Action_Save' postmessage when HideSaveOption is true

This reverts commit 34f3dd4a62.

Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: I5e6425621550153547278a61a936ba9dc7e4aad1
2023-11-30 14:00:03 +01:00
Caolán McNamara
48002c5d40 allow testing wasm in non-debug mode
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I583a8104f590e26a76837bef00814684e2015c7a
2023-11-30 12:58:42 +00:00
Miklos Vajna
07db53bb6e wsd: handle Poco::URISyntaxException in AdminSocketHandler::handleMessage()
terminate called after throwing an instance of 'Poco::URISyntaxException'
    #8 0x7f014e70dc86 in std::terminate() (/usr/lib64/libstdc++.so.6+0xb7c86) (BuildId: c74eca671e2dd0f063706372d103f8acef88f1e3)
    #9 0x7f014e70dee7 in __cxa_throw (/usr/lib64/libstdc++.so.6+0xb7ee7) (BuildId: c74eca671e2dd0f063706372d103f8acef88f1e3)
    #10 0x7f014dcea45b in Poco::URI::decode(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, bool) (/usr/lib64/libPocoFoundation.so.92+0x15145b) (BuildId: 32601204eb877c998d0122c4bef1c7c08c8d0285)
    #11 0x56496c48320b in Util::decodeURIComponent(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) /home/vmiklos/git/collaboraonline/online-fuzz/common/Util.cpp:800:9
    #12 0x56496bb21ec0 in AdminSocketHandler::handleMessage(std::vector<char, std::allocator<char>> const&) /home/vmiklos/git/collaboraonline/online-fuzz/wsd/Admin.cpp:84:20

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I07551d92be5ae677d1cf63f0f0092fb838583337
2023-11-29 15:41:00 +00:00
Miklos Vajna
1e125c7bdc Fix fuzzers build
- the HttpEcho build broke with commit
  08d9081280 (net: don't try to set
  TCP_NODELAY on local Unix sockets., 2023-10-30)

- fix an unused variable error from commit
  0631593c96 (wasm: proxy wopi documents,
  2023-11-06).

- the undefined reference to COOLWSD::ForKitProcId probably went wrong
  in commit 3f46c1db44 (kit-in-process:
  pure re-factor to a run-time function to flag this., 2023-11-20)

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I0cf06d188860bdb2f795485a91c7634b596255aa
2023-11-29 15:41:00 +00:00
Caolán McNamara
74b9c72814 need this even if we want to not serve wasm if the headers exist in richdocuments
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I310894e5a72002406eff77b07af76c2b048ffacc
2023-11-27 10:48:44 +00:00
Caolán McNamara
5232e3d735 hack to get this up and working
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I6d3d273f59f58a0c3b2027039dcc7de95ad971b9
2023-11-27 10:48:44 +00:00
Ashod Nakashian
0631593c96 wasm: proxy wopi documents
Change-Id: I3104ac9a6fd180f11aef06b9d4f516a392e021a9
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-11-27 10:48:44 +00:00
Ashod Nakashian
7abeb96cd1 wsd: add StorageConnectionManager::createHttpRequest
Change-Id: Ie690e9c4ea33ae8cea8355d414ed137e7d5130ba
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-11-27 10:48:44 +00:00
Ashod Nakashian
a624a704ac wsd: add StorageConnectionManager
StorageConnectionManager centralizes the
connection creation and management of
Storage sockets and related bits.
This is needed as we move to a more async
model of communicating with the Storage.

Change-Id: I7a44c95c113bbc536e922b5aa3f7cf9b71917c22
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-11-27 10:48:44 +00:00
Ashod Nakashian
94d213c39e wsd: cache files that need no compression separately
Change-Id: I7b46becd330a7a09a05b7973b18c92679104f597
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-11-27 10:48:44 +00:00
Ashod Nakashian
b045c2a7b4 wsd: fix compiler warnings
Change-Id: I9ffa81d97c3b04b4c0608466892f9b59a896e509
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-11-27 10:48:44 +00:00
Darshan-upadhyay1110
de4fe0dfd8 Fix downlaod options in read only mode
- Allowed downlaod options for PDF/PDF as /EPUB
- PDf/PDF as/EPUB will be downlaod in read only mode
Signed-off-by: Darshan-upadhyay1110 <darshan.upadhyay@collabora.com>
Change-Id: Ic6e0c4a16fa5dffc61e61fd4ece9aeeaec1450b9
2023-11-24 09:26:59 +01:00
Darshan-upadhyay1110
3f46c1db44 kit-in-process: pure re-factor to a run-time function to flag this.
Avoids a number of compile time conditionals and adds flexibility.

Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: Iff6b294b504526e70715e436ad33d47c8df4752c
2023-11-22 17:06:29 +00:00
Michael Meeks
e9f5f04dad config loading: avoid using the process name to find the config file.
This enables the kit-in-process re-factor.

Change-Id: I93eb0a721945fb7b03e145b6c9d037ef3ce62589
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2023-11-22 17:06:29 +00:00
Rash419
34f3dd4a62 wsd: disable ctrl+s when HideSaveOption is true
Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: I190a03abcf80176cc2da77fd32190c683852b9a7
2023-11-21 16:13:52 +05:30
genofire
2c63cf62d8 fix: rename metric from doc_pid to doc_info
Change-Id: d03c077629b343e9b4cefd5914e74f89
Signed-off-by: genofire <geno+dev@fireorbit.de>
2023-11-18 14:12:53 +00:00
genofire
e4ac11756a fix: metrics doc_pid use pid as label
so it would be use on the other metrics for lookup with promql group_left

Change-Id: eaba5e26f99b4cb0843c16f6f5b840c6
Signed-off-by: genofire <geno+dev@fireorbit.de>
2023-11-18 14:12:53 +00:00
Michael Meeks
1a4dafa3e5 Fetch available memory and limits from our control group not the system.
To test:

sudo mkdir /sys/fs/cgroup/memory/0
echo "900M" | sudo tee /sys/fs/cgroup/memory/0/memory.limit_in_bytes
echo $$ | sudo tee /sys/fs/cgroup/memory/0/tasks
make run # and check the log.

Change-Id: I81cf5f6212418d1f900a56cdfe476e1594f4fe77
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2023-11-14 19:36:31 +00:00
Michael Meeks
7183a3d3de spdx: improve machine and human readability of headers.
Change-Id: Ice934380029bf27054e830fffc07a5d037d1430f
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2023-11-14 19:36:31 +00:00
Michael Meeks
2238a40cca Log thread count and memory usage on startup.
Helpful for diagnosing resource constrained systems.

Change-Id: I9e31298d6fa1f5243175350ba48699c0772d486c
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2023-11-14 19:36:31 +00:00
Caolán McNamara
ed8f95c1bc empty updates seen on first view of document
this is visible even with hello-world.odt in the debugging overlay where
I have 9 cols and 7 rows visible.

Load hello-world.odt and from the 4th row, 8th col onwards each tile has
a "upd: 1" of an additional empty delta update to the original tile

browser-side:
a) we have one OUTGOING: tilecombine request which which requests an
   initial 72 tiles (9 cols, 8 rows)
b) we then receive 72 tiles as requested
c) and browser sends back tileprocessed for each
d) but we then get a series of (38) delta: requests after that which are
   unexplained

server-side:
a) on the initial tilecombine, DocumentBroker::handleTileCombinedRequest
   sends the 72 requested tiles for rendering and registers to send each when
   ready.

    for (auto& tile : tileCombined.getTiles())
    {
        ...
        tilesNeedsRendering.push_back(tile);
        ...
        tileCache().subscribeToTileRendering(tile, session, now);
    }

    // Send rendering request, prerender before we actually send the tiles
    if (!tilesNeedsRendering.empty())
        sendTileCombine(TileCombined::create(tilesNeedsRendering));

    and stores what tiles it want to send in session->getRequestedTiles()

    before calling sendRequestedTiles(session);

b) at this sendRequestedTiles (also later when tileprocessed is seen from
   each tile response from the browser which also calls sendRequestedTiles), then:

c) DocumentBroker::sendRequestedTiles loops over existing requests and drops
   from session->getRequestedTiles() both the tiles that it can send immediately,
   and those that are queued to get rendered.

d) But it only does this for a max amount of tiles, based on beingRendered, up to
   a tilesOnFlyUpperLimit. beingRendered is bumped for each tile not ready yet,
   on the assumption that it needs to be rendered.

e) But we already have some getting rendered, and bump beingRendered anyway,
   so tilesOnFlyUpperLimit can easily get exceeded on a first page, typically this
   first sendRequestedTiles loop stops early, and stops dropping tiles from the
   request queue that are already queued to be rendered.

f) at some point we get a tileprocessed and sendRequestedTiles is called again,
   the request queue wasn't emptied, and by now it is likely the tile cache has
   results for them (which were already sent) and sendTileNow is used to send those,
   resulting in additional empty deltas sent for fulfilled queries.

logs will show "Redundant request to subscribe on tile" warnings in this case

Here as a conservative improvement only increase beingRendered if the sendRequestedTiles
subscribeToTileRendering actually does anything.

There is a mismatch in what handleTileCombinedRequest does vs what
sendRequestedTiles does. Maybe handleTileCombinedRequest should leave it
to sendRequestedTiles to do the sendTileCombine, or maybe
handleTileCombinedRequest shouldn't add those tiles to the session
requestedTiles.

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I3044f4b3e47f00c680aa5b87dd7bdad2f27e8c73
2023-11-13 14:27:53 +00:00
Skyler Grey
ff1e4eeb57 Add a ui_defaults hint for touchscreens
At the moment, we try to detect whether the browser is running with a
touchscreen, however this is very imperfect. It's possible an integrator
may have more information about whether COOL is running on a device with
a touchscreen, so this ui_defaults option allows us to specify. Touch
mode binds inputs for touchscreen devices (long press for menu, pinch to
zoom, etc.) and does not bind the normal inputs (right click for menu,
etc.), so it's crucial to get it on all touch devices and no desktop
devices, as input is severely hampered if they are the wrong way round.

The option is called TouchscreenHint. Setting it to 'true' will enable
touchscreen mode, setting it to 'false' will disable touchscreen mode.
Leaving it undefined will keep our detection active.

This option must be set at page load so we can register the right
events at creation time. Therefore, ui_defaults is perfect as a method
to override this.

This is not a long-term solution. Instead, "The right thing" is to look
specifically for touch events and specifically for mouse events, rather
than using the default hammer.js behavior which is to look for both...
that should be an eventual followup to this. However, this was a lot
faster to implement and helps with the most pressing issue: not being
able to override our detection when it goes wrong.

Change-Id: Id28a156fe352fe6565ce6b472b7aa54d0869c48e
Signed-off-by: Skyler Grey <skyler.grey@collabora.com>
2023-11-10 23:20:22 +00:00
Andras Timar
23574cd6b6 missing continue keyword
Caused log ERR on startup:
[ websrv_poll ] ERR  unknown UI default's component UITheme| wsd/FileServerUtil.cpp:99

Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: I82f036e393cfb271e2dec2c52c5dc512aed265c8
2023-11-09 13:36:45 +01:00
Hubert Figuière
00050a59c2 browser: Add ui_default to hide the toolbar
Signed-off-by: Hubert Figuière <hub@collabora.com>
Change-Id: I189224581451c9f5d534593696b060c8efb23414
2023-11-08 23:34:17 +00:00
Skyler Grey
7175c7841b Add a ui_defaults option for onscreen keyboards
The new ui_defaults option OnscreenKeyboardHint is a tristate denoting
whether the device accessing Collabora Online has an onscreen keyboard

If unset, Collabora Online will do its best to guess. At time of
writing, this is the same as checking if the device is a mobile phone
or a tablet (note: only tablets which have the browser registered as a
"mobile" browser will be detected, e.g. the Microsoft Surface tablets
would not be detected)

If "true", Collabora will assume the device has an onscreen keyboard.
This will change when we trigger the keyboard, for example in calc if we
know of an onscreen keyboard we will not automatically focus a cell for
editing when it is selected, as this would pop up the keyboard.

If "false", Collabora will assume the device does not have an onscreen
keyboard, effectively doing the inverse of the "true" option above.

This is a followup to #7580 (0bf054c9a3)
which had Hint_OnscreenKeyboard and Hint_NoOnscreenKeyboard as
postmessage IDs to do the same thing.

Signed-off-by: Skyler Grey <skyler.grey@collabora.com>
Change-Id: I5deeb87a410c135d4cabda7ed24dc37e791800cd
2023-11-08 16:20:49 +00:00
Hubert Figuière
1114af585a default-ui: Allow skipping the UI state saved in local storage.
Pass SavedUIState=false to the ui_defaults

Signed-off-by: Hubert Figuière <hub@collabora.com>
Change-Id: I2cceffed338440d1fee5b0818e072ecc02379468
2023-11-08 10:12:42 -05:00
Michael Meeks
08d9081280 net: don't try to set TCP_NODELAY on local Unix sockets.
Change-Id: Ic0f720554080a01b7a46abbffda023834016c0ea
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2023-11-01 08:06:53 +00:00
Michael Meeks
47b89b32ef spdx: improve machine and human readability of headers.
Change-Id: I1b6dcd2ec1fbef6556d70b8af3ccfd5d6a95c59a
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2023-10-31 10:33:07 +00:00
Ashod Nakashian
8728cd5ea1 wsd: config cleanup and warning fixes
Change-Id: Idb66227d98f8fcca35307c3598a1fcc6b69e38c6
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-10-26 20:31:45 -04:00
Areg Nakashian
8a735d4faf Remove unused requestloksession command
This removes the unused requestloksession command
and all references to it, including protocol documentation.

Signed-off-by: Areg Nakashian <ss4crifice@gmail.com>
Change-Id: I8c410460a5f500f724996fbcbf8f9650028daaf9
2023-10-24 21:35:38 -04:00
Ashod Nakashian
d9d13d7092 wasm: support serving wasm files
Updates README with instructions.

Change-Id: I5188d3ca267ff88a956dc17f302a70bda1046266
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-10-24 21:33:02 -04:00
Ashod Nakashian
184a4a522e killpoco: replace HTTPResponse in sendFileAndShutdown
We now use our http::Response in HttpHelper::sendFileAndShutdown.

Change-Id: I77503fce7a66a11435bad896d3d5d6df611544be
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-10-24 21:33:02 -04:00
Ashod Nakashian
bd056aef91 wsd: test: proper parsing of http header in UnitHttp
This removes the literal string comparison of the
received http header with proper parsing and
comparison.

Change-Id: I383794aa1dc791632ec9d5ed2191880a57d457ee
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-10-24 21:33:02 -04:00
Ashod Nakashian
6ed5dc9a64 wsd: http: no need to pass the mime-type explicitly to sendFile
Since we already have an http response instance (in all but
one case, prior to this change), there is no need to pass
the mime-type explicitly to the sendFileAndShutdown
function, only to set it on the http response.

There are already too many arguments and the mime-type
is surely redundant.

Change-Id: Iab64074dc111573b87fb8fa9b907c26a4160910c
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-10-24 21:33:02 -04:00
Ashod Nakashian
0c59eda780 wsd: http: use named HTTP status-code instead of naked int
Self-documenting, less error-prone, and searchable.

Change-Id: Ifc21d7cf5512d9a63c5d5bc10ebc003fcccc93c1
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-10-24 21:33:02 -04:00
Caolán McNamara
3a9089ea95 cid#318929 Big parameter passed by value
this is called from only one place where the arguments are already
passed by const reference, i.e.
void AdminModel::addDocument(const std::string&, ...  const Poco::URI& wopiSrc, ...)
so might as well forword as const reference and construct the copies in
this ctor.

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I4fe0ed4a4dd8cb71aa970798760d8488be68f82b
2023-10-24 09:23:47 +02:00
Caolán McNamara
03782fff83 cid#318932 Structurally dead code
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I7dc171a701825c67abf1df9b13c5df689e1d0921
2023-10-20 17:01:47 +02:00
Caolán McNamara
7c9c0f487e cid#321979 Big parameter passed by value
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: Id514b14c6bfda08cd561d5c75ab2430b933a8919
2023-10-20 17:01:47 +02:00
Szymon Kłos
181cb7fe78 Fix media request error
It fixes richdocumentscode case when trying to request media:
[ websrv_poll ] ERR  #-1: Failed to open file [.../9a2gf9.ogg] for uploading| net/HttpRequest.hpp:1603

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: Ia326f46a4a1aae28dbf03519ca88c03f499c281c
2023-10-20 11:40:07 +02:00
Caolán McNamara
6c67b072fa cid#318855 Unchecked return value from library
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I9572414e3cfc8426ca6b25872231470f072c5aad
2023-10-20 08:25:07 +02:00