Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/neutrinolabs/ulalaca-xrdp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGyuhwan Park <unstabler@unstabler.pl>2022-05-28 11:52:40 +0300
committerGyuhwan Park <unstabler@unstabler.pl>2022-05-28 12:08:56 +0300
commit11372faa40dd48cd44d8bc891cdfd06d00458931 (patch)
tree286a49834973594daba167d0369ff61ef4d6e165
parent0c5ffd7159b5f88878ec17d8bb19157aa960b1b6 (diff)
fix(IPCConnection): do not throw exception even write() has failed
-rw-r--r--IPCConnection.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/IPCConnection.cpp b/IPCConnection.cpp
index 3da91c4..fd50dd1 100644
--- a/IPCConnection.cpp
+++ b/IPCConnection.cpp
@@ -91,15 +91,17 @@ void IPCConnection::workerLoop() {
bool canWrite = (pollFd.revents & POLLOUT) > 0;
if (canWrite && !_writeTasks.empty()) {
- auto writeTask = std::move(_writeTasks.front());
+ auto &writeTask = _writeTasks.front();
+
if (_socket.write(writeTask.second.get(), writeTask.first) < 0) {
if (errno == EAGAIN) {
continue;
}
-
- throw SystemCallException(errno, "write");
+
+ LOG(LOG_LEVEL_ERROR, "write() failed (errno=%d)", errno);
+ continue;
}
-
+
{
std::scoped_lock<std::mutex> scopedWriteTasksLock(_writeTasksLock);
_writeTasks.pop();