diff options
| author | 2020-07-21 06:15:16 -0400 | |
|---|---|---|
| committer | 2020-07-21 06:15:16 -0400 | |
| commit | 37a7155ea7c504b308a8afa642c653a12bbe5f84 (patch) | |
| tree | bd68ea5d2a2400dcd04b1aa85617534e66aba94c /src/lib/ipc | |
| parent | 1ae09e76cde035d716763fc88b570535884cd50f (diff) | |
| parent | fbc30002ab3438356c0476e70c4577a0310d52c0 (diff) | |
Update upstream source from tag 'upstream/2.3.3+dfsg'
Update to upstream version '2.3.3+dfsg'
with Debian dir f7eeed313bc1a4c2bda69f04f0316ee29651397f
Diffstat (limited to 'src/lib/ipc')
| -rw-r--r-- | src/lib/ipc/IpcClientProxy.cpp | 4 | ||||
| -rw-r--r-- | src/lib/ipc/IpcLogOutputter.cpp | 10 | ||||
| -rw-r--r-- | src/lib/ipc/IpcLogOutputter.h | 7 | ||||
| -rw-r--r-- | src/lib/ipc/IpcMessage.cpp | 14 | ||||
| -rw-r--r-- | src/lib/ipc/IpcMessage.h | 14 | ||||
| -rw-r--r-- | src/lib/ipc/IpcServerProxy.cpp | 4 |
6 files changed, 26 insertions, 27 deletions
diff --git a/src/lib/ipc/IpcClientProxy.cpp b/src/lib/ipc/IpcClientProxy.cpp index 5104277..432cc8c 100644 --- a/src/lib/ipc/IpcClientProxy.cpp +++ b/src/lib/ipc/IpcClientProxy.cpp @@ -141,7 +141,7 @@ IpcClientProxy::send(const IpcMessage& message) switch (message.type()) { case kIpcLogLine: { const IpcLogLineMessage& llm = static_cast<const IpcLogLineMessage&>(message); - const String logLine = llm.logLine(); + const std::string logLine = llm.logLine(); ProtocolUtil::writef(&m_stream, kIpcMsgLogLine, &logLine); break; } @@ -171,7 +171,7 @@ IpcClientProxy::parseHello() IpcCommandMessage* IpcClientProxy::parseCommand() { - String command; + std::string command; UInt8 elevate; ProtocolUtil::readf(&m_stream, kIpcMsgCommand + 4, &command, &elevate); diff --git a/src/lib/ipc/IpcLogOutputter.cpp b/src/lib/ipc/IpcLogOutputter.cpp index b62c76a..44ecdba 100644 --- a/src/lib/ipc/IpcLogOutputter.cpp +++ b/src/lib/ipc/IpcLogOutputter.cpp @@ -44,8 +44,8 @@ IpcLogOutputter::IpcLogOutputter(IpcServer& ipcServer, EIpcClientType clientType m_running(false), m_notifyCond(ARCH->newCondVar()), m_notifyMutex(ARCH->newMutex()), - m_bufferThreadId(0), m_bufferWaiting(false), + m_bufferThreadId(0), m_bufferMaxSize(kBufferMaxSize), m_bufferRateWriteLimit(kBufferRateWriteLimit), m_bufferRateTimeLimit(kBufferRateTimeLimit), @@ -109,8 +109,7 @@ IpcLogOutputter::write(ELevel, const char* text) return true; } -void -IpcLogOutputter::appendBuffer(const String& text) +void IpcLogOutputter::appendBuffer(const std::string& text) { std::lock_guard<std::mutex> lock(m_bufferMutex); @@ -173,8 +172,7 @@ IpcLogOutputter::notifyBuffer() ARCH->broadcastCondVar(m_notifyCond); } -String -IpcLogOutputter::getChunk(size_t count) +std::string IpcLogOutputter::getChunk(size_t count) { std::lock_guard<std::mutex> lock(m_bufferMutex); @@ -182,7 +180,7 @@ IpcLogOutputter::getChunk(size_t count) count = m_buffer.size(); } - String chunk; + std::string chunk; for (size_t i = 0; i < count; i++) { chunk.append(m_buffer.front()); chunk.append("\n"); diff --git a/src/lib/ipc/IpcLogOutputter.h b/src/lib/ipc/IpcLogOutputter.h index 2f1b98c..cc7b2fe 100644 --- a/src/lib/ipc/IpcLogOutputter.h +++ b/src/lib/ipc/IpcLogOutputter.h @@ -21,6 +21,7 @@ #include "arch/Arch.h" #include "arch/IArchMultithread.h" #include "base/ILogOutputter.h" +#include "base/String.h" #include "ipc/Ipc.h" #include <deque> @@ -92,12 +93,12 @@ public: private: void init(); void bufferThread(void*); - String getChunk(size_t count); - void appendBuffer(const String& text); + std::string getChunk(size_t count); + void appendBuffer(const std::string& text); bool isRunning(); private: - typedef std::deque<String> Buffer; + typedef std::deque<std::string> Buffer; IpcServer& m_ipcServer; Buffer m_buffer; diff --git a/src/lib/ipc/IpcMessage.cpp b/src/lib/ipc/IpcMessage.cpp index deef22d..9c321cb 100644 --- a/src/lib/ipc/IpcMessage.cpp +++ b/src/lib/ipc/IpcMessage.cpp @@ -47,9 +47,9 @@ IpcShutdownMessage::~IpcShutdownMessage() { } -IpcLogLineMessage::IpcLogLineMessage(const String& logLine) : -IpcMessage(kIpcLogLine), -m_logLine(logLine) +IpcLogLineMessage::IpcLogLineMessage(const std::string& logLine) : + IpcMessage(kIpcLogLine), + m_logLine(logLine) { } @@ -57,10 +57,10 @@ IpcLogLineMessage::~IpcLogLineMessage() { } -IpcCommandMessage::IpcCommandMessage(const String& command, bool elevate) : -IpcMessage(kIpcCommand), -m_command(command), -m_elevate(elevate) +IpcCommandMessage::IpcCommandMessage(const std::string& command, bool elevate) : + IpcMessage(kIpcCommand), + m_command(command), + m_elevate(elevate) { } diff --git a/src/lib/ipc/IpcMessage.h b/src/lib/ipc/IpcMessage.h index 5cc3d79..d37ebc3 100644 --- a/src/lib/ipc/IpcMessage.h +++ b/src/lib/ipc/IpcMessage.h @@ -20,8 +20,8 @@ #include "ipc/Ipc.h" #include "base/EventTypes.h" -#include "base/String.h" #include "base/Event.h" +#include <string> class IpcMessage : public EventData { public: @@ -58,28 +58,28 @@ public: class IpcLogLineMessage : public IpcMessage { public: - IpcLogLineMessage(const String& logLine); + IpcLogLineMessage(const std::string& logLine); virtual ~IpcLogLineMessage(); //! Gets the log line. - String logLine() const { return m_logLine; } + std::string logLine() const { return m_logLine; } private: - String m_logLine; + std::string m_logLine; }; class IpcCommandMessage : public IpcMessage { public: - IpcCommandMessage(const String& command, bool elevate); + IpcCommandMessage(const std::string& command, bool elevate); virtual ~IpcCommandMessage(); //! Gets the command. - String command() const { return m_command; } + std::string command() const { return m_command; } //! Gets whether or not the process should be elevated on MS Windows. bool elevate() const { return m_elevate; } private: - String m_command; + std::string m_command; bool m_elevate; }; diff --git a/src/lib/ipc/IpcServerProxy.cpp b/src/lib/ipc/IpcServerProxy.cpp index 820e1ab..49b3e00 100644 --- a/src/lib/ipc/IpcServerProxy.cpp +++ b/src/lib/ipc/IpcServerProxy.cpp @@ -94,7 +94,7 @@ IpcServerProxy::send(const IpcMessage& message) case kIpcCommand: { const IpcCommandMessage& cm = static_cast<const IpcCommandMessage&>(message); - const String command = cm.command(); + std::string command = cm.command(); ProtocolUtil::writef(&m_stream, kIpcMsgCommand, &command); break; } @@ -108,7 +108,7 @@ IpcServerProxy::send(const IpcMessage& message) IpcLogLineMessage* IpcServerProxy::parseLogLine() { - String logLine; + std::string logLine; ProtocolUtil::readf(&m_stream, kIpcMsgLogLine + 4, &logLine); // must be deleted by event handler. |
