[Libreoffice-commits] online.git: loolwsd/LOOLBroker.cpp
Henry Castro
hcastro at collabora.com
Tue Jan 26 19:31:06 PST 2016
loolwsd/LOOLBroker.cpp | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
New commits:
commit aad79ea3c587c9e15ebfde2a87f7997871b36d89
Author: Henry Castro <hcastro at collabora.com>
Date: Tue Jan 26 23:28:42 2016 -0400
loolwsd: ensure response PID child
diff --git a/loolwsd/LOOLBroker.cpp b/loolwsd/LOOLBroker.cpp
index 78c4fe6..f9117ef 100644
--- a/loolwsd/LOOLBroker.cpp
+++ b/loolwsd/LOOLBroker.cpp
@@ -264,7 +264,7 @@ public:
}
StringTokenizer tokens(aResponse, " ", StringTokenizer::TOK_IGNORE_EMPTY | StringTokenizer::TOK_TRIM);
- return (tokens.count() == 2 && tokens[1] == "ok");
+ return (tokens.count() == 2 && tokens[0] == std::to_string(nPID) && tokens[1] == "ok");
}
void verifyChilds()
@@ -292,7 +292,7 @@ public:
}
StringTokenizer tokens(aResponse, " ", StringTokenizer::TOK_IGNORE_EMPTY | StringTokenizer::TOK_TRIM);
- if (tokens.count() != 2 || tokens[1] != "ok")
+ if (tokens.count() != 2 || tokens[0] != std::to_string(it->second) || tokens[1] != "ok")
{
Log::debug() << "Removed expired Kit [" << it->second << "] hosts URL [" << it->first << "]." << Log::end;
it = _cacheURL.erase(it);
@@ -335,6 +335,12 @@ public:
}
StringTokenizer tokens(aResponse, " ", StringTokenizer::TOK_IGNORE_EMPTY | StringTokenizer::TOK_TRIM);
+ if (tokens.count() != 2 || tokens[0] != std::to_string(it->first))
+ {
+ Log::error("Error wrong child response from child [" + std::to_string(it->first) + "] != [" + tokens[0] + "]");
+ continue;
+ }
+
if (tokens[1] == "ok")
{
// Found, but find all empty instances.
More information about the Libreoffice-commits
mailing list