mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-03-05 21:16:52 +00:00
AK+ProtocolServer: Properly close download stream fd's
This makes the issue of running out of openable pipes in the ProtocolServer process much less likely (but still possible).
This commit is contained in:
committed by
Andreas Kling
parent
bdd4b99d72
commit
6422a04cda
@@ -72,7 +72,9 @@ OwnPtr<Messages::ProtocolServer::StartDownloadResponse> ClientConnection::handle
|
||||
auto id = download->id();
|
||||
auto fd = download->download_fd();
|
||||
m_downloads.set(id, move(download));
|
||||
return make<Messages::ProtocolServer::StartDownloadResponse>(id, fd);
|
||||
auto response = make<Messages::ProtocolServer::StartDownloadResponse>(id, fd);
|
||||
response->on_destruction = [fd] { close(fd); };
|
||||
return response;
|
||||
}
|
||||
|
||||
OwnPtr<Messages::ProtocolServer::StopDownloadResponse> ClientConnection::handle(const Messages::ProtocolServer::StopDownload& message)
|
||||
|
||||
Reference in New Issue
Block a user