[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-2-0' - 2 commits - common/IoUtil.cpp kit/ForKit.cpp
Ashod Nakashian
ashod.nakashian at collabora.co.uk
Wed Nov 30 03:16:11 UTC 2016
common/IoUtil.cpp | 2 ++
kit/ForKit.cpp | 4 ++--
2 files changed, 4 insertions(+), 2 deletions(-)
New commits:
commit 7e5d83f41c42e8deac48f0dcff54768ec9cfc87f
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date: Mon Nov 28 20:34:18 2016 -0500
loolwsd: terminate forkit when wsd dies
When we the pipe with wsd is closed we
assume wsd has died and we terminate too.
WSD can fork us anew, if it's still alive.
Change-Id: I669ed717db973b50498a6bc08e1fca59c6563443
Reviewed-on: https://gerrit.libreoffice.org/31337
Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
Tested-by: Ashod Nakashian <ashnakash at gmail.com>
(cherry picked from commit 7a4250b90e4273f73ab5ab94c35728aeba9f0d63)
diff --git a/common/IoUtil.cpp b/common/IoUtil.cpp
index 6fea0b4..32238f3 100644
--- a/common/IoUtil.cpp
+++ b/common/IoUtil.cpp
@@ -329,6 +329,7 @@ int PipeReader::readLine(std::string& line,
}
else if (pipe.revents & (POLLERR | POLLHUP | POLLNVAL))
{
+ LOG_FTL("Pipe closed.");
return -1;
}
}
diff --git a/kit/ForKit.cpp b/kit/ForKit.cpp
index 4680c4d..b727817 100644
--- a/kit/ForKit.cpp
+++ b/kit/ForKit.cpp
@@ -75,9 +75,9 @@ public:
if (ready <= 0)
{
// Termination is done via SIGTERM, which breaks the wait.
- if (TerminationFlag)
+ if (ready < 0)
{
- if (ready < 0)
+ if (TerminationFlag)
{
LOG_INF("Poll interrupted in " << getName() << " and Termination flag set.");
}
commit 644eeafa013b031d33b764233b75a517a48d8e9b
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date: Mon Nov 28 21:38:34 2016 -0500
Revert "IoUtil: remove never read write of 'n'"
Setting 'n = -1;' helps to detect where the failure happened
when receiveFrame throws. At the bottom of the function we log
partially processed data by checking n (among others).
This reverts commit 752372a2b022ad4a450df61bcc58c978840b9b37.
Change-Id: I3294329c3d95b38d72c3fc824ab2eb7f2339adee
Reviewed-on: https://gerrit.libreoffice.org/31339
Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
Tested-by: Ashod Nakashian <ashnakash at gmail.com>
(cherry picked from commit 21b1287444fc483adb8561243497ef466cd53fa9)
diff --git a/common/IoUtil.cpp b/common/IoUtil.cpp
index 2ee9c84..6fea0b4 100644
--- a/common/IoUtil.cpp
+++ b/common/IoUtil.cpp
@@ -79,6 +79,7 @@ void SocketProcessor(const std::shared_ptr<LOOLWebSocket>& ws,
try
{
payload.resize(payload.capacity());
+ n = -1; // In case receiveFrame throws we log dropped data.
n = ws->receiveFrame(payload.data(), payload.size(), flags);
payload.resize(std::max(n, 0));
}
More information about the Libreoffice-commits
mailing list