/* * Copyright (c) 2018-2020, Andreas Kling * * SPDX-License-Identifier: BSD-2-Clause */ #include #include #include #include namespace RequestServer { HttpRequest::HttpRequest(ConnectionFromClient& client, NonnullRefPtr job, NonnullOwnPtr&& output_stream) : Request(client, move(output_stream)) , m_job(job) { Detail::init(this, job); } HttpRequest::~HttpRequest() { m_job->on_finish = nullptr; m_job->on_progress = nullptr; m_job->cancel(); } NonnullOwnPtr HttpRequest::create_with_job(Badge&&, ConnectionFromClient& client, NonnullRefPtr job, NonnullOwnPtr&& output_stream) { return adopt_own(*new HttpRequest(client, move(job), move(output_stream))); } }