mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-24 18:24:45 -05:00
65f7e45a75
This makes connections (particularly TLS-based ones) do the handshaking stuff only once. Currently the cache is configured to keep at most two connections evenly balanced in queue size, and with a grace period of 10s after the last queued job has finished (after which the connection will be dropped).
31 lines
820 B
C++
31 lines
820 B
C++
/*
|
|
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/Badge.h>
|
|
#include <AK/NonnullOwnPtr.h>
|
|
#include <LibCore/Forward.h>
|
|
#include <LibHTTP/Forward.h>
|
|
#include <RequestServer/Request.h>
|
|
|
|
namespace RequestServer {
|
|
|
|
class HttpRequest final : public Request {
|
|
public:
|
|
virtual ~HttpRequest() override;
|
|
static NonnullOwnPtr<HttpRequest> create_with_job(Badge<HttpProtocol>&&, ClientConnection&, NonnullRefPtr<HTTP::HttpJob>, NonnullOwnPtr<OutputFileStream>&&);
|
|
|
|
HTTP::HttpJob& job() { return m_job; }
|
|
HTTP::HttpJob const& job() const { return m_job; }
|
|
|
|
private:
|
|
explicit HttpRequest(ClientConnection&, NonnullRefPtr<HTTP::HttpJob>, NonnullOwnPtr<OutputFileStream>&&);
|
|
|
|
NonnullRefPtr<HTTP::HttpJob> m_job;
|
|
};
|
|
|
|
}
|