1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-17 21:55:07 +00:00

ProtocolServer: Attach downloads and their lifecycles to clients

Previously a download lived independently of the client connection it came
from. This was the source of several undesirable behaviours, including the
potential for clients to influence downloads they didn't start, and
downloads living longer than their associated client connections. Now we
attach downloads to client connections, which means they're cleaned up
automatically when the client goes away, and there's significantly less
risk of clients interfering with each other.
This commit is contained in:
Conrad Pankoff 2020-05-16 05:36:40 +10:00 committed by Andreas Kling
parent 184ee8ac77
commit f2621f37a4
17 changed files with 48 additions and 57 deletions

View file

@ -38,7 +38,7 @@ HttpProtocol::~HttpProtocol()
{
}
RefPtr<Download> HttpProtocol::start_download(PSClientConnection& client, const URL& url)
OwnPtr<Download> HttpProtocol::start_download(PSClientConnection& client, const URL& url)
{
HTTP::HttpRequest request;
request.set_method(HTTP::HttpRequest::Method::GET);