diff options
author | Andreas Kling <kling@serenityos.org> | 2020-05-27 18:06:20 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-05-27 18:30:29 +0200 |
commit | a34258b3d79b5a71997100af1920ba9aca0ed909 (patch) | |
tree | 0fe3ea2a2becf01d36f1310408bc77daa885ed4a | |
parent | a5ce09f8e37dabe1877ce64cb7adab4a4ce5240d (diff) | |
download | serenity-a34258b3d79b5a71997100af1920ba9aca0ed909.zip |
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.
-rw-r--r-- | Services/ProtocolServer/ClientConnection.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Services/ProtocolServer/ClientConnection.cpp b/Services/ProtocolServer/ClientConnection.cpp index f688dc58a8..b9f78e2520 100644 --- a/Services/ProtocolServer/ClientConnection.cpp +++ b/Services/ProtocolServer/ClientConnection.cpp @@ -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); |