[Libreoffice-commits] online.git: 2 commits - kit/Kit.cpp test/WhiteBoxTests.cpp wsd/Admin.cpp
Ashod Nakashian
ashod.nakashian at collabora.co.uk
Fri Feb 3 07:09:01 UTC 2017
kit/Kit.cpp | 8 +++++++-
test/WhiteBoxTests.cpp | 2 +-
wsd/Admin.cpp | 1 +
3 files changed, 9 insertions(+), 2 deletions(-)
New commits:
commit ae8c352928fc337e38a69d76d6ba41e0db5c07d7
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date: Tue Jan 31 22:50:09 2017 -0500
wsd: access AdminModel instance under lock
Change-Id: I6c5c07dafa69f052ee81e7cbecb4d1f2b772fef9
Reviewed-on: https://gerrit.libreoffice.org/33863
Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
Tested-by: Ashod Nakashian <ashnakash at gmail.com>
diff --git a/wsd/Admin.cpp b/wsd/Admin.cpp
index 4c0b55d..6d62878 100644
--- a/wsd/Admin.cpp
+++ b/wsd/Admin.cpp
@@ -389,6 +389,7 @@ AdminModel& Admin::getModel()
void Admin::updateLastActivityTime(const std::string& docKey)
{
+ std::unique_lock<std::mutex> modelLock(_modelMutex);
_model.updateLastActivityTime(docKey);
}
commit b9a7e1ef0343bfeef6885a4cf5a8cd385eaf97f2
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date: Tue Jan 31 22:48:14 2017 -0500
wsd: improved test and cosmetics
Change-Id: I25a0a27c12394f41af8e021b72627b1c0537a166
Reviewed-on: https://gerrit.libreoffice.org/33862
Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
Tested-by: Ashod Nakashian <ashnakash at gmail.com>
diff --git a/kit/Kit.cpp b/kit/Kit.cpp
index 2d0ebeb..cb9c778 100644
--- a/kit/Kit.cpp
+++ b/kit/Kit.cpp
@@ -1395,16 +1395,20 @@ private:
const std::string& target = tokens[1];
if (target == "all")
+ {
broadcast = true;
+ }
else if (LOOLProtocol::matchPrefix("except-", target))
{
exceptViewId = std::stoi(target.substr(7));
broadcast = true;
}
else
+ {
viewId = std::stoi(target);
+ }
- int type = std::stoi(tokens[2]);
+ const int type = std::stoi(tokens[2]);
// payload is the rest of the message
const auto offset = tokens[0].length() + tokens[1].length() + tokens[2].length() + 3; // + delims
@@ -1431,7 +1435,9 @@ private:
}
if (!broadcast)
+ {
break;
+ }
}
}
diff --git a/test/WhiteBoxTests.cpp b/test/WhiteBoxTests.cpp
index 689f6c4..27469d4 100644
--- a/test/WhiteBoxTests.cpp
+++ b/test/WhiteBoxTests.cpp
@@ -59,7 +59,7 @@ void WhiteBoxTests::testLOOLProtocolFunctions()
CPPUNIT_ASSERT(LOOLProtocol::getTokenKeyword("mumble=goodbye", "mumble", map, mumble));
CPPUNIT_ASSERT_EQUAL(2, mumble);
- std::string message("hello x=1 y=2 foo=42 bar=hello-sailor mumble=goodbye zip zap");
+ std::string message("hello x=1 y=2 foo=42 bar=hello-sailor mumble='goodbye' zip zap");
Poco::StringTokenizer tokens(message, " ", Poco::StringTokenizer::TOK_IGNORE_EMPTY | Poco::StringTokenizer::TOK_TRIM);
CPPUNIT_ASSERT(LOOLProtocol::getTokenInteger(tokens, "foo", foo));
More information about the Libreoffice-commits
mailing list