[Libreoffice-commits] online.git: loolwsd/MasterProcessSession.cpp
Henry Castro
hcastro at collabora.com
Thu Mar 10 19:40:41 UTC 2016
loolwsd/MasterProcessSession.cpp | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
New commits:
commit 2e49729ff46a57a81cb197635de4f2a33968b852
Author: Henry Castro <hcastro at collabora.com>
Date: Thu Mar 10 15:36:38 2016 -0400
loolwsd: coding style minor correctness
diff --git a/loolwsd/MasterProcessSession.cpp b/loolwsd/MasterProcessSession.cpp
index 99b147e..18b9cec 100644
--- a/loolwsd/MasterProcessSession.cpp
+++ b/loolwsd/MasterProcessSession.cpp
@@ -754,35 +754,35 @@ void MasterProcessSession::sendCombinedTiles(const char* /*buffer*/, int /*lengt
void MasterProcessSession::dispatchChild()
{
- int nRequest = 3;
- bool bFound = false;
+ int retries = 3;
+ bool isFound = false;
// Wait until the child has connected with Master.
std::shared_ptr<MasterProcessSession> childSession;
std::unique_lock<std::mutex> lock(AvailableChildSessionMutex);
Log::debug() << "Waiting for a child session permission for thread [" << getId() << "]." << Log::end;
- while (nRequest-- && !bFound)
+ while (retries-- && !isFound)
{
AvailableChildSessionCV.wait_for(
lock,
std::chrono::milliseconds(3000),
- [&bFound, this]
+ [&isFound, this]
{
- return (bFound = AvailableChildSessions.find(getId()) != AvailableChildSessions.end());
+ return (isFound = AvailableChildSessions.find(getId()) != AvailableChildSessions.end());
});
- if (!bFound)
+ if (!isFound)
{
- Log::info() << "Retrying child permission... " << nRequest << Log::end;
+ Log::info() << "Retrying child permission... " << retries << Log::end;
// request again new URL session
- const std::string aMessage = "request " + getId() + " " + _docURL + "\r\n";
- Log::trace("MasterToBroker: " + aMessage.substr(0, aMessage.length()-2));
- Util::writeFIFO(LOOLWSD::BrokerWritePipe, aMessage);
+ const std::string message = "request " + getId() + " " + _docURL + "\r\n";
+ Log::trace("MasterToBroker: " + message.substr(0, message.length()-2));
+ Util::writeFIFO(LOOLWSD::BrokerWritePipe, message);
}
}
- if (bFound)
+ if (isFound)
{
Log::debug("Waiting child session permission, done!");
childSession = AvailableChildSessions[getId()];
@@ -791,7 +791,7 @@ void MasterProcessSession::dispatchChild()
lock.unlock();
- if (nRequest < 0 && !bFound)
+ if (retries < 0 && !isFound)
{
Log::error(getName() + ": Failed to connect to child. Shutting down socket.");
Util::shutdownWebSocket(_ws);
More information about the Libreoffice-commits
mailing list