diff options
author | Gyuhwan Park <unstabler@unstabler.pl> | 2022-10-07 08:53:37 +0300 |
---|---|---|
committer | Gyuhwan Park <unstabler@unstabler.pl> | 2022-10-07 08:53:37 +0300 |
commit | 569d286962a19146f2f0a8e2babfc2b98679d800 (patch) | |
tree | 86cce08b27c6481ebbd5131a2e3b5885f03770ac | |
parent | 3d841ddb09539bb5fb252f6b26c1a738a1129183 (diff) |
fix(IPCConnection): flush read tasks and close connection when POLLHUP bit set
-rw-r--r-- | IPCConnection.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/IPCConnection.cpp b/IPCConnection.cpp index d74cd44..317a27d 100644 --- a/IPCConnection.cpp +++ b/IPCConnection.cpp @@ -150,6 +150,11 @@ void IPCConnection::workerLoop() { if (pollFd.revents & POLLHUP) { LOG(LOG_LEVEL_WARNING, "POLLHUP bit set"); + + if (_readTasks.empty()) { + LOG(LOG_LEVEL_WARNING, "POLLHUP bit set; closing connection"); + break; + } } if (pollFd.revents & POLLERR) { |