We only run one task in each thread when run() is called, then complete
the remainder of tasks in the main thread while the other threads wait.
https: //github.com/CollaboraOnline/online/issues/7374
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: Id4fc0a620d98b0bb55310b495eeff7411a4544b5
use a more standard way to zero the _sb stat struct
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I98973affe6b96a5779cfc3eef3c349019c34d0a0
- Allow COOLWSD client sessions to forward messages with the prefix
'urp' to the child, and return messages with 'urp:' to the client,
communicating with binary
- Make COOLWSD child sessions use the FunctionBasedURPConnection from
https://gerrit.libreoffice.org/c/core/+/155100
(core change ID I2bda3d0b988bef7883f9b6829eeb5b7ae8075f27) to start a
new URP session
- Make COOLWSD child sessions submit messages to this URP session,
stripping and adding the 'urp' and 'urp:' prefixes so the Java client
from https://gerrit.libreoffice.org/c/core/+/154680
(core change ID I91ee52922a24688a6b94512cb7e7bc760bf25ec9) can
use the connection (and to avoid interference with any other websocket
messages)
- Add a COOLWSD option for enabling/disabling URP given the security
implications around allowing anyone to write URP (e.g. URP lets you
run shell commands so a mallicious actor can take over the child
session)
Signed-off-by: Skyler Grey <skyler.grey@collabora.com>
Change-Id: Idadfe288a78cfd72b01253dfdade150d506e3f05
This replaces Poco's LocalDateTime, which
took a lock, called tzset each time, and
did unnecessary Julian-to-Gregorian conversion.
The result is a standards-compliant implementation
that is about an order of magnitude faster (0.3 us
vs 3 us on average).
Change-Id: Iced73056a9f9e6497106224c351110113e21d8d6
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
This verifies that in debug-builds the log
thread-local buffers are destroyed, and
therefore the threads are gracefully stopped.
This is necessary to make sure no log entries
are lost by the time we exit the process.
Change-Id: I0db20835109e92d8758a5c4eec6845cd240da025
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
This gives each logging thread its own buffer.
We then guarantee that all threads exit clearly
and flush their buffers.
For now, we don't flush buffers when fatally signaled,
primarily because of technical complexities.
Specifically, we don't know if we have a Poco logger
or our Buffered Logger, and there are a host of
threading and signal-safety concerns. To be revisited.
Change-Id: I39674a25feeee3aabd87c8b707ea1adf3c039817
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
This replaces Poco's ColorConsoleChannel with our
own, which is simpler and more efficient. It also
doesn't break log entries arbitrarily (only when
the entry is exceedingly long).
Change-Id: I46ba58d35bc913ca83fe97aaaa958c03b81ae44e
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
This is a buffered version of our ConsoleChannel.
Change-Id: Ie1728e136376fdf82ec28010b67d8344fd812768
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Now that we depend on EnableExperimental in Log.cpp,
we must define it in the standalone binaries that
otherwise don't define it.
Change-Id: Ic56032eaf6df7d0d5d707a60eeddf2d75c9041ac
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
This replaces Poco's implementation of ConsoleChannel
which has a horrible issue with writing the new line
in a separate syscall. This often results in multiple
log entries on the same line and other horrors.
This implementation does no buffering.
Change-Id: I8d18de1313d8f160270ec04552ba7e7b69d2363e
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
and avoid local static in simd_initPixRowSimd
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: Idb89d5069da5ff10b346b5e4d767374d4529a96f
Split it out as a C file, to avoid accidental C++ header inclusion,
and C is a cross-platform assembler anyway so a good match.
Change-Id: I6c042781713aecaf143b9663af8377659a7deaf1
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
We now exit immediately with error code when
we are given --unitlib argument but fail to
load the given library.
Change-Id: I4eb5f3a37b9838ecf83bdceef4d09f888afcca83
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Given a well-formed utf-8 string 'message' of messageLen bytes and a
desire to truncate to approximately abbrevLen bytes return the shortest
string greater or equal to abbrevLen that does not split a utf-8
sequence.
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: Ie623d8c1027bb4724485cab5b0bb6d3d1cd3d9ab
they sometimes do, and sometimes not, we can't assume that the last
byte is a newline and can be discarded without truncating message
text.
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: Ie5ea00f927a558b43b2ae38e1cac96c805e93fcc
for a short non-abbreviated message if it ended in a newline which the
more common variant would not.
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I4105fb8eb67b3a38aebc745dfb1e79aa99f2d878
the std::string variant uses:
Util::getDelimiterPosition(message.data(), std::min<size_t>(message.size(), maxNonAbbreviatedMsgLen + 1),...
while the more commonly used const char* version has
getFirstLine(message, std::min(length, maxNonAbbreviatedMsgLen)
where getFirstLine is...
return Util::getDelimitedInitialSubstring(message, length,...
and getDelimitedInitialSubstring has
const size_t size = getDelimiterPosition(message, length, delim);
return std::string(message, size);
so the std::string variant's condition is one char longer for the same input
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I5b8c4523844501a43731ff3b4a939b76ebe472c3
perf reported 6.58% of time in collaborative multi user test
on 2023-08-24 was spent in TileDesc::parse and much of that
in std::unordered_map.
There are only 12 arguments in the map we care about here so
we can just used a sorted array, look by name on write, and
read by index.
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: Iadfc2001e298d8f4d46200c8488f0eb4cd8734c2
which isn't available in the current android toolchain
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I5834adb7c6211c7aad38f5977a7e425d9ca257fd
With the use of a single flag for both, the
logic is now less ambiguous, as we cannot have
termination flagged without also implying
shutting down.
The assertions are no longer needed.
Now that setting the termination flag
explicitly implies having the shut down flag
as well, the checks are simpler. We only
need to check that the shutdown is not set
to continue running as normal, since having
the termination flag must perfoce mean shut
down is also set, there is no need to check
both.
Change-Id: I99e22f5668385182b0594040a8e3354b55e74642
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Also tilecombine request now uses the canonicalviewid
Signed-off-by: Paris Oplopoios <paris.oplopoios@collabora.com>
Change-Id: Ib386edcf78de17cb4fc3d8c3c6ce65f6b52c8b5f
std::make_shared and std::make_unique
are superior to explict smart pointer
construction. Where we have private
constructors, we can't use them.
Change-Id: I492122f58e958113c6e6d31445c6614ad98c89aa
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Added toggle button/menu entry for enable/disable accessibility support.
This ui feature is available for Online Writer only.
The button/menu entry is added only when accessibility is enabled at
server level.
That allows to enable/disable accessibility per view.
By default, the accessibility support is disabled.
Anyway the accessibility support state is saved to local storage
if available.
Signed-off-by: Marco Cecchetti <marco.cecchetti@collabora.com>
Change-Id: If5968a47f17922038b9da3d320cbed84ebb7688b