Add a way to search with an offset in findInVector() and then we can
avoid strstr() which assumes a null-terminated input, which may not be
the case.
READ of size 55 at 0x606000068a56 thread T8 (docbroker_001)
#0 0x55d0d6718a5a in StrstrCheck(void*, char*, char const*, char const*) /home/abuild/rpmbuild/BUILD/llvm-15.0.7.src/build/../projects/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc:652:5
#1 0x55d0d6718882 in __interceptor_strstr /home/abuild/rpmbuild/BUILD/llvm-15.0.7.src/build/../projects/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc:669:5
#2 0x55d0d71872c9 in ClientSession::postProcessCopyPayload(std::shared_ptr<Message> const&)::$_4::operator()(std::vector<char, std::allocator<char>>&) const /home/vmiklos/git/collaboraonline/online-23.05-san/wsd/ClientSession.cpp:1631:31
During unit-uno-command.
Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: Id42669d912bab4746d9f7d99a192c4c3f1d175f7
This class will be responsible for faster
variable replacement to serve the templates.
Change-Id: Ic0d75b0a197c0db75c0988c3b6af400a5b1c35a2
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
But re-write them anyway to be more sensible.
Change-Id: Ie146f4f84b539ab7e826a1c1b947497acde7e384
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
The JS code does the same at
browser/src/layer/tile/CanvasTileLayer.js:3074.
In preparation of picking core.git
51d8a2ef54751403fa707816e27ddb4e7faa8231 (cool#7492 sfx2 lok: fix bad
view id / statusbar string on async binding update, 2024-01-08) to
core.git co-23.05: this online.git commit should go in first to avoid
breakage.
Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I652e5c738b7e137970a820de2d71f9c03ba6df7e
When always_save_on_exit=true we should
still not upload the document when it
isn't modified.
In this case, because we now always
save the document (forced) when
always_save_on_exit=true, and because
saving always generates a new file on
disk, with a new timestamp, we couldn't
detect that there are no modifications.
We now still force save, but ask Core
to skip it if the document is unmodified.
This is safe since we now always issue
the save, but rely on Core to do the
right thing. When the document is saved,
we do the normal upload as in that case
we know we have a new version of the
document, which must be uploaded.
Worth noting that the closedocument
command doesn't trigger the same path.
To reproduce the issue, we need a new
test that disconnects, instead of the
graceful closedocument command.
Change-Id: Iaa4e0363ed2eca124f2d1943393e65c0c187aa18
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
This forces autoSave when always_save_on_exit
is true. This is needed so we can guarantee
that we don't have modification and that
we upload if there has every been one.
The latter case is checked in
DocumentBroker::needToUploadToStorage(),
which is called from
DocumentBroker::checkAndUploadToStorage().
A new test reproduces the issue and defends
the fix.
Change-Id: I0b2105a57cfd7049ba7b1f63e62a700fdc3744c2
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Let clearOldQuarantineVersions() remove quarantined
files only when necessary and per the config settings.
Change-Id: Ie1fb18c02d61a710546e9b5962ab8b7973c2066e
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
We now use our http::Response in HttpHelper::sendFileAndShutdown.
Change-Id: I77503fce7a66a11435bad896d3d5d6df611544be
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Since we don't want to propagate Poco types
as well as our pair containers, it's best
to have these are named functions rather
than as operator<<.
Change-Id: I9772b8f314262147b6c445464bf3ce8cb598b56d
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>
Unfotunately, if our custom test driver run_unit.sh
fails, the report isn't generated at all.
So, instead, we have to go back to parsing the trs
file to detect success and failure.
We now make fast-fail an option instead.
Also fixes a typo in run_unit_standalone.sh.
Change-Id: I337c2a3edceda01df5f9c13c83eb176930b07e34
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
with the original 25 expected results from 25 requests
from cid#318925 Structurally dead code
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I236876fadd5b5c82ecdbcc52a13fc58e8513aa12
for coverity always assert even if a previous test was to fail
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: Ic48654d828a5311e043f412d9c30139e25b40262
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 returns from the connect helper sooner,
shaving some time from each connection.
Change-Id: I29e2637c16b9e2574cbfb99779551d7ae1c8c2f0
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
just enough to get the same results as before
https://github.com/CollaboraOnline/online/issues/7165
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I109c9b8f1e7935782c72e0179aa0ed48712eadb6
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>
The test now runs as many times as requested
and doesn't stop on first failure. Instead,
it reports the number of passing vs failing
runs.
Also simplifies the detection of the test
result by using the exit code instead
of grepping the output file.
Change-Id: Ie458b2963411632d566cd87d2dfb9137044d2b4b
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
New unit-test that reproduces the corner-case
with disconnection. With graceful unloading
a previous unit-test verified that it worked
as expected.
This is restored from e6798e9062
after it was reverted (due to a PDF comment saving regression).
Since the issue is fixed separately in
0b27e85fc5, these tests can
now be restored.
Change-Id: Id84cda4f4599c559018247c32ea1205e154e4984
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
This disables the unreliable reload test.
On a slow box, sometimes the load takes
a little longer than 5 seconds. Waiting
a bit longer doesn't hurt in these cases.
Also, remove duplicate test and give each
test case its own testname.
Change-Id: I556f6da9e49a7fa4cd9917bc9964dd9561b93817
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
This test is currently disabled, as it is only
useful for stress-testing
Change-Id: I803d8d5818f004afa72bbf2dfe5c9d90b41e1133
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Fixes a race-condition due to having multiple
views, we will get multiple onDocumentModified.
Change-Id: I806a3cc31f768c9f159e599c69fd1d31755e6cd1
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
This reverts commit e6798e9062.
Reason: this commit caused a regression. PDF comments were not saved.
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: I180ecb9e298e37bd5a989a8cd6d23d02c25a6929