summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-05-27 18:06:20 +0200
committerAndreas Kling <kling@serenityos.org>2020-05-27 18:30:29 +0200
commita34258b3d79b5a71997100af1920ba9aca0ed909 (patch)
tree0fe3ea2a2becf01d36f1310408bc77daa885ed4a
parenta5ce09f8e37dabe1877ce64cb7adab4a4ce5240d (diff)
downloadserenity-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.cpp3
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);