Skip to content

Commit 8cc587d

Browse files
committed
Connection: close on EPOLLHUP, eliminate last recvmsg() call
1 parent 95fa58a commit 8cc587d

3 files changed

Lines changed: 9 additions & 0 deletions

File tree

debian/changelog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ cm4all-spawn (0.23) unstable; urgency=low
22

33
* accessory: rename the PID namespace init process to "init"
44
* accessory: support user namespaces
5+
* accessory: eliminate last recvmsg() system call on closed connection
56

67
--
78

src/accessory/Connection.cxx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,13 @@ try {
157157
return false;
158158
}
159159

160+
bool
161+
SpawnConnection::OnUdpHangup()
162+
{
163+
delete this;
164+
return false;
165+
}
166+
160167
void
161168
SpawnConnection::OnUdpError(std::exception_ptr ep) noexcept
162169
{

src/accessory/Connection.hxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,6 @@ private:
3838
bool OnUdpDatagram(std::span<const std::byte> payload,
3939
std::span<UniqueFileDescriptor> fds,
4040
SocketAddress address, int uid) override;
41+
bool OnUdpHangup() override;
4142
void OnUdpError(std::exception_ptr ep) noexcept override;
4243
};

0 commit comments

Comments
 (0)