ProtocolServer: Forget downloads after they are stopped

Stopping means the client no longer cares about the download, so we
should just forget about it in the server.
This commit is contained in:
Andreas Kling 2020-05-27 18:06:20 +02:00
parent a5ce09f8e3
commit a34258b3d7
Notes: sideshowbarker 2024-07-19 06:04:23 +09:00

View file

@ -26,8 +26,8 @@
#include <AK/Badge.h>
#include <AK/SharedBuffer.h>
#include <ProtocolServer/Download.h>
#include <ProtocolServer/ClientConnection.h>
#include <ProtocolServer/Download.h>
#include <ProtocolServer/Protocol.h>
#include <ProtocolServer/ProtocolClientEndpoint.h>
@ -78,6 +78,7 @@ OwnPtr<Messages::ProtocolServer::StopDownloadResponse> ClientConnection::handle(
bool success = false;
if (download) {
download->stop();
m_downloads.remove(message.download_id());
success = true;
}
return make<Messages::ProtocolServer::StopDownloadResponse>(success);