loolwsd/Admin.cpp | 8 ++++---- loolwsd/Admin.hpp | 4 ++-- loolwsd/LOOLBroker.cpp | 6 +++--- loolwsd/LOOLKit.cpp | 10 +++++----- loolwsd/LOOLWSD.cpp | 8 ++++---- 5 files changed, 18 insertions(+), 18 deletions(-)
New commits: commit ae8ce061629b1edc02ab2d2925e75b6beaf4a6f0 Author: Ashod Nakashian <ashod.nakash...@collabora.co.uk> Date: Sat Apr 2 20:40:09 2016 -0400 loolwsd: removed unnecessary from pipe messages Change-Id: I5fc310f98764b31fc50f877c28d6076bbb14866f Reviewed-on: https://gerrit.libreoffice.org/23784 Reviewed-by: Ashod Nakashian <ashnak...@gmail.com> Tested-by: Ashod Nakashian <ashnak...@gmail.com> diff --git a/loolwsd/Admin.cpp b/loolwsd/Admin.cpp index 374b250..572aba3 100644 --- a/loolwsd/Admin.cpp +++ b/loolwsd/Admin.cpp @@ -194,7 +194,7 @@ void AdminRequestHandler::handleWSRequests(HTTPServerRequest& request, HTTPServe { if (std::stoi(tokens[1])) { - IoUtil::writeFIFO(LOOLWSD::BrokerWritePipe, firstLine + " \r\n"); + IoUtil::writeFIFO(LOOLWSD::BrokerWritePipe, firstLine + "\n"); } } catch(std::exception& e) diff --git a/loolwsd/LOOLBroker.cpp b/loolwsd/LOOLBroker.cpp index f6c81d4..a529316 100644 --- a/loolwsd/LOOLBroker.cpp +++ b/loolwsd/LOOLBroker.cpp @@ -92,7 +92,7 @@ namespace std::ostringstream message; message << "rmdoc" << " " << _pid << " " - << "\r\n"; + << "\n"; IoUtil::writeFIFO(WriterNotify, message.str()); _pid = -1; } diff --git a/loolwsd/LOOLKit.cpp b/loolwsd/LOOLKit.cpp index bce288f..b37269b 100644 --- a/loolwsd/LOOLKit.cpp +++ b/loolwsd/LOOLKit.cpp @@ -697,7 +697,7 @@ private: message << "document" << " " << Process::id() << " " << uri.substr(uri.find_last_of("/") + 1) << " " - << "\r\n"; + << "\n"; IoUtil::writeFIFO(WriterNotify, message.str()); if (_multiView) @@ -1146,7 +1146,7 @@ void lokit_main(const std::string& childRoot, std::ostringstream message; message << "rmdoc" << " " << Process::id() << " " - << "\r\n"; + << "\n"; IoUtil::writeFIFO(WriterNotify, message.str()); close(WriterNotify); commit aacd16267366344f01bcb4b762593f0aacba11fc Author: Ashod Nakashian <ashod.nakash...@collabora.co.uk> Date: Sat Apr 2 18:23:55 2016 -0400 loolwsd: FIFO_NOTIFY -> FIFO_ADMIN_NOTIFY Change-Id: Ia42983010b3962ca9228032817c6f9024a74c59f Reviewed-on: https://gerrit.libreoffice.org/23783 Reviewed-by: Ashod Nakashian <ashnak...@gmail.com> Tested-by: Ashod Nakashian <ashnak...@gmail.com> diff --git a/loolwsd/Admin.cpp b/loolwsd/Admin.cpp index 2ad3d3d..374b250 100644 --- a/loolwsd/Admin.cpp +++ b/loolwsd/Admin.cpp @@ -400,7 +400,7 @@ Admin::Admin(const Poco::Process::PID brokerPid, const int notifyPipe) : _model(AdminModel()) { Admin::BrokerPid = brokerPid; - Admin::NotifyPipe = notifyPipe; + Admin::AdminNotifyPipe = notifyPipe; } Admin::~Admin() @@ -490,7 +490,7 @@ void Admin::run() Log::info("Thread [" + thread_name + "] started."); // Start listening for data changes. - IoUtil::PipeReader pipeReader(FIFO_NOTIFY, NotifyPipe); + IoUtil::PipeReader pipeReader(FIFO_ADMIN_NOTIFY, AdminNotifyPipe); pipeReader.process([this](std::string& message) { handleInput(message); return true; }, []() { return TerminationFlag; }); @@ -507,6 +507,6 @@ AdminModel& Admin::getModel() //TODO: Clean up with something more elegant. Poco::Process::PID Admin::BrokerPid; -int Admin::NotifyPipe; +int Admin::AdminNotifyPipe; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/loolwsd/Admin.hpp b/loolwsd/Admin.hpp index d1ecf7a..6a91a10 100644 --- a/loolwsd/Admin.hpp +++ b/loolwsd/Admin.hpp @@ -20,7 +20,7 @@ #include "AdminModel.hpp" -const std::string FIFO_NOTIFY = "loolnotify.fifo"; +const std::string FIFO_ADMIN_NOTIFY = "lool_admin_notify.fifo"; class Admin; @@ -84,7 +84,7 @@ private: static Poco::Process::PID BrokerPid; static int BrokerPipe; - static int NotifyPipe; + static int AdminNotifyPipe; }; class MemoryStats : public Poco::Util::TimerTask diff --git a/loolwsd/LOOLBroker.cpp b/loolwsd/LOOLBroker.cpp index 3f3aae2..f6c81d4 100644 --- a/loolwsd/LOOLBroker.cpp +++ b/loolwsd/LOOLBroker.cpp @@ -537,10 +537,10 @@ void setupPipes(const std::string &childRoot, bool doBenchmark) if (!doBenchmark) { // Open notify pipe - const std::string pipeNotify = Path(pipePath, FIFO_NOTIFY).toString(); + const std::string pipeNotify = Path(pipePath, FIFO_ADMIN_NOTIFY).toString(); if ((WriterNotify = open(pipeNotify.c_str(), O_WRONLY) ) < 0) { - Log::error("Error: failed to open notify pipe [" + FIFO_NOTIFY + "] for writing."); + Log::error("Error: failed to open notify pipe [" + FIFO_ADMIN_NOTIFY + "] for writing."); exit(Application::EXIT_SOFTWARE); } } diff --git a/loolwsd/LOOLKit.cpp b/loolwsd/LOOLKit.cpp index f5ba8cd..bce288f 100644 --- a/loolwsd/LOOLKit.cpp +++ b/loolwsd/LOOLKit.cpp @@ -67,7 +67,7 @@ using Poco::Thread; using Poco::Util::Application; const std::string FIFO_BROKER = "loolbroker.fifo"; -const std::string FIFO_NOTIFY = "loolnotify.fifo"; +const std::string FIFO_ADMIN_NOTIFY = "lool_admin_notify.fifo"; static int WriterNotify = -1; @@ -881,10 +881,10 @@ void lokit_main(const std::string& childRoot, if (!doBenchmark) { // Open notify pipe - const std::string pipeNotify = Path(pipePath, FIFO_NOTIFY).toString(); + const std::string pipeNotify = Path(pipePath, FIFO_ADMIN_NOTIFY).toString(); if ((WriterNotify = open(pipeNotify.c_str(), O_WRONLY) ) < 0) { - Log::error("Error: failed to open notify pipe [" + FIFO_NOTIFY + "] for writing."); + Log::error("Error: failed to open notify pipe [" + FIFO_ADMIN_NOTIFY + "] for writing."); exit(Application::EXIT_SOFTWARE); } } diff --git a/loolwsd/LOOLWSD.cpp b/loolwsd/LOOLWSD.cpp index 535edb0..a2c3466 100644 --- a/loolwsd/LOOLWSD.cpp +++ b/loolwsd/LOOLWSD.cpp @@ -1150,10 +1150,10 @@ int LOOLWSD::main(const std::vector<std::string>& /*args*/) // Open notify pipe int pipeFlags = O_RDONLY | O_NONBLOCK; int notifyPipe = -1; - const std::string pipeNotify = Path(pipePath, FIFO_NOTIFY).toString(); + const std::string pipeNotify = Path(pipePath, FIFO_ADMIN_NOTIFY).toString(); if (mkfifo(pipeNotify.c_str(), 0666) < 0 && errno != EEXIST) { - Log::error("Error: Failed to create pipe FIFO [" + FIFO_NOTIFY + "]."); + Log::error("Error: Failed to create pipe FIFO [" + FIFO_ADMIN_NOTIFY + "]."); exit(Application::EXIT_SOFTWARE); } @@ -1165,14 +1165,14 @@ int LOOLWSD::main(const std::vector<std::string>& /*args*/) if ((pipeFlags = fcntl(notifyPipe, F_GETFL, 0)) < 0) { - Log::error("Error: failed to get pipe flags [" + FIFO_NOTIFY + "]."); + Log::error("Error: failed to get pipe flags [" + FIFO_ADMIN_NOTIFY + "]."); exit(Application::EXIT_SOFTWARE); } pipeFlags &= ~O_NONBLOCK; if (fcntl(notifyPipe, F_SETFL, pipeFlags) < 0) { - Log::error("Error: failed to set pipe flags [" + FIFO_NOTIFY + "]."); + Log::error("Error: failed to set pipe flags [" + FIFO_ADMIN_NOTIFY + "]."); exit(Application::EXIT_SOFTWARE); } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits