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
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
Also add state dumping of tile on the fly statistics per session.
Change-Id: I8413cdfd489be3c238738f95d9d5c4aa177ff262
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
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
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
- 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
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
- 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
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>
- 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
Avoids a number of compile time conditionals and adds flexibility.
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: Iff6b294b504526e70715e436ad33d47c8df4752c
This enables the kit-in-process re-factor.
Change-Id: I93eb0a721945fb7b03e145b6c9d037ef3ce62589
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
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>
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>
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
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>
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
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
We now use our http::Response in HttpHelper::sendFileAndShutdown.
Change-Id: I77503fce7a66a11435bad896d3d5d6df611544be
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
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>
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>
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
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