mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 20:07:34 +00:00
Services: Rename ProtocolServer to RequestServer
The current ProtocolServer was really only used for requests, and with the recent introduction of the WebSocket service, long-lasting connections with another server are not part of it. To better reflect this, this commit renames it to RequestServer. This commit also changes the existing 'protocol' portal to 'request', the existing 'protocol' user and group to 'request', and most mentions of the 'download' aspect of the request to 'request' when relevant, to make everything consistent across the system. Note that LibProtocol still exists as-is, but the more generic Client class and the more specific Download class have both been renamed to a more accurate RequestClient and Request to match the new names. This commit only change names, not behaviors.
This commit is contained in:
parent
22413ef729
commit
71d27abb97
58 changed files with 786 additions and 788 deletions
|
@ -1,13 +1,13 @@
|
|||
set(SOURCES
|
||||
Client.cpp
|
||||
Download.cpp
|
||||
Request.cpp
|
||||
RequestClient.cpp
|
||||
WebSocket.cpp
|
||||
WebSocketClient.cpp
|
||||
)
|
||||
|
||||
set(GENERATED_SOURCES
|
||||
../../Services/ProtocolServer/ProtocolClientEndpoint.h
|
||||
../../Services/ProtocolServer/ProtocolServerEndpoint.h
|
||||
../../Services/RequestServer/RequestClientEndpoint.h
|
||||
../../Services/RequestServer/RequestServerEndpoint.h
|
||||
../../Services/WebSocket/WebSocketClientEndpoint.h
|
||||
../../Services/WebSocket/WebSocketServerEndpoint.h
|
||||
)
|
||||
|
|
|
@ -1,98 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <AK/FileStream.h>
|
||||
#include <LibProtocol/Client.h>
|
||||
#include <LibProtocol/Download.h>
|
||||
|
||||
namespace Protocol {
|
||||
|
||||
Client::Client()
|
||||
: IPC::ServerConnection<ProtocolClientEndpoint, ProtocolServerEndpoint>(*this, "/tmp/portal/protocol")
|
||||
{
|
||||
handshake();
|
||||
}
|
||||
|
||||
void Client::handshake()
|
||||
{
|
||||
send_sync<Messages::ProtocolServer::Greet>();
|
||||
}
|
||||
|
||||
bool Client::is_supported_protocol(const String& protocol)
|
||||
{
|
||||
return send_sync<Messages::ProtocolServer::IsSupportedProtocol>(protocol)->supported();
|
||||
}
|
||||
|
||||
template<typename RequestHashMapTraits>
|
||||
RefPtr<Download> Client::start_download(const String& method, const String& url, const HashMap<String, String, RequestHashMapTraits>& request_headers, ReadonlyBytes request_body)
|
||||
{
|
||||
IPC::Dictionary header_dictionary;
|
||||
for (auto& it : request_headers)
|
||||
header_dictionary.add(it.key, it.value);
|
||||
|
||||
auto response = send_sync<Messages::ProtocolServer::StartDownload>(method, url, header_dictionary, ByteBuffer::copy(request_body));
|
||||
auto download_id = response->download_id();
|
||||
if (download_id < 0 || !response->response_fd().has_value())
|
||||
return nullptr;
|
||||
auto response_fd = response->response_fd().value().take_fd();
|
||||
auto download = Download::create_from_id({}, *this, download_id);
|
||||
download->set_download_fd({}, response_fd);
|
||||
m_downloads.set(download_id, download);
|
||||
return download;
|
||||
}
|
||||
|
||||
bool Client::stop_download(Badge<Download>, Download& download)
|
||||
{
|
||||
if (!m_downloads.contains(download.id()))
|
||||
return false;
|
||||
return send_sync<Messages::ProtocolServer::StopDownload>(download.id())->success();
|
||||
}
|
||||
|
||||
bool Client::set_certificate(Badge<Download>, Download& download, String certificate, String key)
|
||||
{
|
||||
if (!m_downloads.contains(download.id()))
|
||||
return false;
|
||||
return send_sync<Messages::ProtocolServer::SetCertificate>(download.id(), move(certificate), move(key))->success();
|
||||
}
|
||||
|
||||
void Client::handle(const Messages::ProtocolClient::DownloadFinished& message)
|
||||
{
|
||||
RefPtr<Download> download;
|
||||
if ((download = m_downloads.get(message.download_id()).value_or(nullptr))) {
|
||||
download->did_finish({}, message.success(), message.total_size());
|
||||
}
|
||||
m_downloads.remove(message.download_id());
|
||||
}
|
||||
|
||||
void Client::handle(const Messages::ProtocolClient::DownloadProgress& message)
|
||||
{
|
||||
if (auto download = const_cast<Download*>(m_downloads.get(message.download_id()).value_or(nullptr))) {
|
||||
download->did_progress({}, message.total_size(), message.downloaded_size());
|
||||
}
|
||||
}
|
||||
|
||||
void Client::handle(const Messages::ProtocolClient::HeadersBecameAvailable& message)
|
||||
{
|
||||
if (auto download = const_cast<Download*>(m_downloads.get(message.download_id()).value_or(nullptr))) {
|
||||
HashMap<String, String, CaseInsensitiveStringTraits> headers;
|
||||
message.response_headers().for_each_entry([&](auto& name, auto& value) { headers.set(name, value); });
|
||||
download->did_receive_headers({}, headers, message.status_code());
|
||||
}
|
||||
}
|
||||
|
||||
OwnPtr<Messages::ProtocolClient::CertificateRequestedResponse> Client::handle(const Messages::ProtocolClient::CertificateRequested& message)
|
||||
{
|
||||
if (auto download = const_cast<Download*>(m_downloads.get(message.download_id()).value_or(nullptr))) {
|
||||
download->did_request_certificates({});
|
||||
}
|
||||
|
||||
return make<Messages::ProtocolClient::CertificateRequestedResponse>();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
template RefPtr<Protocol::Download> Protocol::Client::start_download(const String& method, const String& url, const HashMap<String, String>& request_headers, ReadonlyBytes request_body);
|
||||
template RefPtr<Protocol::Download> Protocol::Client::start_download(const String& method, const String& url, const HashMap<String, String, CaseInsensitiveStringTraits>& request_headers, ReadonlyBytes request_body);
|
|
@ -1,44 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/HashMap.h>
|
||||
#include <LibIPC/ServerConnection.h>
|
||||
#include <ProtocolServer/ProtocolClientEndpoint.h>
|
||||
#include <ProtocolServer/ProtocolServerEndpoint.h>
|
||||
|
||||
namespace Protocol {
|
||||
|
||||
class Download;
|
||||
|
||||
class Client
|
||||
: public IPC::ServerConnection<ProtocolClientEndpoint, ProtocolServerEndpoint>
|
||||
, public ProtocolClientEndpoint {
|
||||
C_OBJECT(Client);
|
||||
|
||||
public:
|
||||
virtual void handshake() override;
|
||||
|
||||
bool is_supported_protocol(const String&);
|
||||
template<typename RequestHashMapTraits = Traits<String>>
|
||||
RefPtr<Download> start_download(const String& method, const String& url, const HashMap<String, String, RequestHashMapTraits>& request_headers = {}, ReadonlyBytes request_body = {});
|
||||
|
||||
bool stop_download(Badge<Download>, Download&);
|
||||
bool set_certificate(Badge<Download>, Download&, String, String);
|
||||
|
||||
private:
|
||||
Client();
|
||||
|
||||
virtual void handle(const Messages::ProtocolClient::DownloadProgress&) override;
|
||||
virtual void handle(const Messages::ProtocolClient::DownloadFinished&) override;
|
||||
virtual OwnPtr<Messages::ProtocolClient::CertificateRequestedResponse> handle(const Messages::ProtocolClient::CertificateRequested&) override;
|
||||
virtual void handle(const Messages::ProtocolClient::HeadersBecameAvailable&) override;
|
||||
|
||||
HashMap<i32, RefPtr<Download>> m_downloads;
|
||||
};
|
||||
|
||||
}
|
|
@ -4,23 +4,23 @@
|
|||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibProtocol/Client.h>
|
||||
#include <LibProtocol/Download.h>
|
||||
#include <LibProtocol/Request.h>
|
||||
#include <LibProtocol/RequestClient.h>
|
||||
|
||||
namespace Protocol {
|
||||
|
||||
Download::Download(Client& client, i32 download_id)
|
||||
Request::Request(RequestClient& client, i32 request_id)
|
||||
: m_client(client)
|
||||
, m_download_id(download_id)
|
||||
, m_request_id(request_id)
|
||||
{
|
||||
}
|
||||
|
||||
bool Download::stop()
|
||||
bool Request::stop()
|
||||
{
|
||||
return m_client->stop_download({}, *this);
|
||||
return m_client->stop_request({}, *this);
|
||||
}
|
||||
|
||||
void Download::stream_into(OutputStream& stream)
|
||||
void Request::stream_into(OutputStream& stream)
|
||||
{
|
||||
VERIFY(!m_internal_stream_data);
|
||||
|
||||
|
@ -33,7 +33,7 @@ void Download::stream_into(OutputStream& stream)
|
|||
on_finish = [this](auto success, auto total_size) {
|
||||
m_internal_stream_data->success = success;
|
||||
m_internal_stream_data->total_size = total_size;
|
||||
m_internal_stream_data->download_done = true;
|
||||
m_internal_stream_data->request_done = true;
|
||||
};
|
||||
|
||||
notifier->on_ready_to_read = [this, &stream, user_on_finish = move(user_on_finish)] {
|
||||
|
@ -45,7 +45,7 @@ void Download::stream_into(OutputStream& stream)
|
|||
TODO();
|
||||
}
|
||||
|
||||
if (m_internal_stream_data->read_stream.eof() && m_internal_stream_data->download_done) {
|
||||
if (m_internal_stream_data->read_stream.eof() && m_internal_stream_data->request_done) {
|
||||
m_internal_stream_data->read_notifier->close();
|
||||
user_on_finish(m_internal_stream_data->success, m_internal_stream_data->total_size);
|
||||
} else {
|
||||
|
@ -54,7 +54,7 @@ void Download::stream_into(OutputStream& stream)
|
|||
};
|
||||
}
|
||||
|
||||
void Download::set_should_buffer_all_input(bool value)
|
||||
void Request::set_should_buffer_all_input(bool value)
|
||||
{
|
||||
if (m_should_buffer_all_input == value)
|
||||
return;
|
||||
|
@ -67,7 +67,7 @@ void Download::set_should_buffer_all_input(bool value)
|
|||
|
||||
VERIFY(!m_internal_stream_data);
|
||||
VERIFY(!m_internal_buffered_data);
|
||||
VERIFY(on_buffered_download_finish); // Not having this set makes no sense.
|
||||
VERIFY(on_buffered_request_finish); // Not having this set makes no sense.
|
||||
m_internal_buffered_data = make<InternalBufferedData>(fd());
|
||||
m_should_buffer_all_input = true;
|
||||
|
||||
|
@ -78,7 +78,7 @@ void Download::set_should_buffer_all_input(bool value)
|
|||
|
||||
on_finish = [this](auto success, u32 total_size) {
|
||||
auto output_buffer = m_internal_buffered_data->payload_stream.copy_into_contiguous_buffer();
|
||||
on_buffered_download_finish(
|
||||
on_buffered_request_finish(
|
||||
success,
|
||||
total_size,
|
||||
m_internal_buffered_data->response_headers,
|
||||
|
@ -89,7 +89,7 @@ void Download::set_should_buffer_all_input(bool value)
|
|||
stream_into(m_internal_buffered_data->payload_stream);
|
||||
}
|
||||
|
||||
void Download::did_finish(Badge<Client>, bool success, u32 total_size)
|
||||
void Request::did_finish(Badge<RequestClient>, bool success, u32 total_size)
|
||||
{
|
||||
if (!on_finish)
|
||||
return;
|
||||
|
@ -97,24 +97,24 @@ void Download::did_finish(Badge<Client>, bool success, u32 total_size)
|
|||
on_finish(success, total_size);
|
||||
}
|
||||
|
||||
void Download::did_progress(Badge<Client>, Optional<u32> total_size, u32 downloaded_size)
|
||||
void Request::did_progress(Badge<RequestClient>, Optional<u32> total_size, u32 downloaded_size)
|
||||
{
|
||||
if (on_progress)
|
||||
on_progress(total_size, downloaded_size);
|
||||
}
|
||||
|
||||
void Download::did_receive_headers(Badge<Client>, const HashMap<String, String, CaseInsensitiveStringTraits>& response_headers, Optional<u32> response_code)
|
||||
void Request::did_receive_headers(Badge<RequestClient>, const HashMap<String, String, CaseInsensitiveStringTraits>& response_headers, Optional<u32> response_code)
|
||||
{
|
||||
if (on_headers_received)
|
||||
on_headers_received(response_headers, response_code);
|
||||
}
|
||||
|
||||
void Download::did_request_certificates(Badge<Client>)
|
||||
void Request::did_request_certificates(Badge<RequestClient>)
|
||||
{
|
||||
if (on_certificate_requested) {
|
||||
auto result = on_certificate_requested();
|
||||
if (!m_client->set_certificate({}, *this, result.certificate, result.key)) {
|
||||
dbgln("Download: set_certificate failed");
|
||||
dbgln("Request: set_certificate failed");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -19,49 +19,49 @@
|
|||
|
||||
namespace Protocol {
|
||||
|
||||
class Client;
|
||||
class RequestClient;
|
||||
|
||||
class Download : public RefCounted<Download> {
|
||||
class Request : public RefCounted<Request> {
|
||||
public:
|
||||
struct CertificateAndKey {
|
||||
String certificate;
|
||||
String key;
|
||||
};
|
||||
|
||||
static NonnullRefPtr<Download> create_from_id(Badge<Client>, Client& client, i32 download_id)
|
||||
static NonnullRefPtr<Request> create_from_id(Badge<RequestClient>, RequestClient& client, i32 request_id)
|
||||
{
|
||||
return adopt_ref(*new Download(client, download_id));
|
||||
return adopt_ref(*new Request(client, request_id));
|
||||
}
|
||||
|
||||
int id() const { return m_download_id; }
|
||||
int id() const { return m_request_id; }
|
||||
int fd() const { return m_fd; }
|
||||
bool stop();
|
||||
|
||||
void stream_into(OutputStream&);
|
||||
|
||||
bool should_buffer_all_input() const { return m_should_buffer_all_input; }
|
||||
/// Note: Will override `on_finish', and `on_headers_received', and expects `on_buffered_download_finish' to be set!
|
||||
/// Note: Will override `on_finish', and `on_headers_received', and expects `on_buffered_request_finish' to be set!
|
||||
void set_should_buffer_all_input(bool);
|
||||
|
||||
/// Note: Must be set before `set_should_buffer_all_input(true)`.
|
||||
Function<void(bool success, u32 total_size, const HashMap<String, String, CaseInsensitiveStringTraits>& response_headers, Optional<u32> response_code, ReadonlyBytes payload)> on_buffered_download_finish;
|
||||
Function<void(bool success, u32 total_size, const HashMap<String, String, CaseInsensitiveStringTraits>& response_headers, Optional<u32> response_code, ReadonlyBytes payload)> on_buffered_request_finish;
|
||||
Function<void(bool success, u32 total_size)> on_finish;
|
||||
Function<void(Optional<u32> total_size, u32 downloaded_size)> on_progress;
|
||||
Function<void(const HashMap<String, String, CaseInsensitiveStringTraits>& response_headers, Optional<u32> response_code)> on_headers_received;
|
||||
Function<CertificateAndKey()> on_certificate_requested;
|
||||
|
||||
void did_finish(Badge<Client>, bool success, u32 total_size);
|
||||
void did_progress(Badge<Client>, Optional<u32> total_size, u32 downloaded_size);
|
||||
void did_receive_headers(Badge<Client>, const HashMap<String, String, CaseInsensitiveStringTraits>& response_headers, Optional<u32> response_code);
|
||||
void did_request_certificates(Badge<Client>);
|
||||
void did_finish(Badge<RequestClient>, bool success, u32 total_size);
|
||||
void did_progress(Badge<RequestClient>, Optional<u32> total_size, u32 downloaded_size);
|
||||
void did_receive_headers(Badge<RequestClient>, const HashMap<String, String, CaseInsensitiveStringTraits>& response_headers, Optional<u32> response_code);
|
||||
void did_request_certificates(Badge<RequestClient>);
|
||||
|
||||
RefPtr<Core::Notifier>& write_notifier(Badge<Client>) { return m_write_notifier; }
|
||||
void set_download_fd(Badge<Client>, int fd) { m_fd = fd; }
|
||||
RefPtr<Core::Notifier>& write_notifier(Badge<RequestClient>) { return m_write_notifier; }
|
||||
void set_request_fd(Badge<RequestClient>, int fd) { m_fd = fd; }
|
||||
|
||||
private:
|
||||
explicit Download(Client&, i32 download_id);
|
||||
WeakPtr<Client> m_client;
|
||||
int m_download_id { -1 };
|
||||
explicit Request(RequestClient&, i32 request_id);
|
||||
WeakPtr<RequestClient> m_client;
|
||||
int m_request_id { -1 };
|
||||
RefPtr<Core::Notifier> m_write_notifier;
|
||||
int m_fd { -1 };
|
||||
bool m_should_buffer_all_input { false };
|
||||
|
@ -88,7 +88,7 @@ private:
|
|||
RefPtr<Core::Notifier> read_notifier;
|
||||
bool success;
|
||||
u32 total_size { 0 };
|
||||
bool download_done { false };
|
||||
bool request_done { false };
|
||||
};
|
||||
|
||||
OwnPtr<InternalBufferedData> m_internal_buffered_data;
|
98
Userland/Libraries/LibProtocol/RequestClient.cpp
Normal file
98
Userland/Libraries/LibProtocol/RequestClient.cpp
Normal file
|
@ -0,0 +1,98 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <AK/FileStream.h>
|
||||
#include <LibProtocol/Request.h>
|
||||
#include <LibProtocol/RequestClient.h>
|
||||
|
||||
namespace Protocol {
|
||||
|
||||
RequestClient::RequestClient()
|
||||
: IPC::ServerConnection<RequestClientEndpoint, RequestServerEndpoint>(*this, "/tmp/portal/request")
|
||||
{
|
||||
handshake();
|
||||
}
|
||||
|
||||
void RequestClient::handshake()
|
||||
{
|
||||
send_sync<Messages::RequestServer::Greet>();
|
||||
}
|
||||
|
||||
bool RequestClient::is_supported_protocol(const String& protocol)
|
||||
{
|
||||
return send_sync<Messages::RequestServer::IsSupportedProtocol>(protocol)->supported();
|
||||
}
|
||||
|
||||
template<typename RequestHashMapTraits>
|
||||
RefPtr<Request> RequestClient::start_request(const String& method, const String& url, const HashMap<String, String, RequestHashMapTraits>& request_headers, ReadonlyBytes request_body)
|
||||
{
|
||||
IPC::Dictionary header_dictionary;
|
||||
for (auto& it : request_headers)
|
||||
header_dictionary.add(it.key, it.value);
|
||||
|
||||
auto response = send_sync<Messages::RequestServer::StartRequest>(method, url, header_dictionary, ByteBuffer::copy(request_body));
|
||||
auto request_id = response->request_id();
|
||||
if (request_id < 0 || !response->response_fd().has_value())
|
||||
return nullptr;
|
||||
auto response_fd = response->response_fd().value().take_fd();
|
||||
auto request = Request::create_from_id({}, *this, request_id);
|
||||
request->set_request_fd({}, response_fd);
|
||||
m_requests.set(request_id, request);
|
||||
return request;
|
||||
}
|
||||
|
||||
bool RequestClient::stop_request(Badge<Request>, Request& request)
|
||||
{
|
||||
if (!m_requests.contains(request.id()))
|
||||
return false;
|
||||
return send_sync<Messages::RequestServer::StopRequest>(request.id())->success();
|
||||
}
|
||||
|
||||
bool RequestClient::set_certificate(Badge<Request>, Request& request, String certificate, String key)
|
||||
{
|
||||
if (!m_requests.contains(request.id()))
|
||||
return false;
|
||||
return send_sync<Messages::RequestServer::SetCertificate>(request.id(), move(certificate), move(key))->success();
|
||||
}
|
||||
|
||||
void RequestClient::handle(const Messages::RequestClient::RequestFinished& message)
|
||||
{
|
||||
RefPtr<Request> request;
|
||||
if ((request = m_requests.get(message.request_id()).value_or(nullptr))) {
|
||||
request->did_finish({}, message.success(), message.total_size());
|
||||
}
|
||||
m_requests.remove(message.request_id());
|
||||
}
|
||||
|
||||
void RequestClient::handle(const Messages::RequestClient::RequestProgress& message)
|
||||
{
|
||||
if (auto request = const_cast<Request*>(m_requests.get(message.request_id()).value_or(nullptr))) {
|
||||
request->did_progress({}, message.total_size(), message.downloaded_size());
|
||||
}
|
||||
}
|
||||
|
||||
void RequestClient::handle(const Messages::RequestClient::HeadersBecameAvailable& message)
|
||||
{
|
||||
if (auto request = const_cast<Request*>(m_requests.get(message.request_id()).value_or(nullptr))) {
|
||||
HashMap<String, String, CaseInsensitiveStringTraits> headers;
|
||||
message.response_headers().for_each_entry([&](auto& name, auto& value) { headers.set(name, value); });
|
||||
request->did_receive_headers({}, headers, message.status_code());
|
||||
}
|
||||
}
|
||||
|
||||
OwnPtr<Messages::RequestClient::CertificateRequestedResponse> RequestClient::handle(const Messages::RequestClient::CertificateRequested& message)
|
||||
{
|
||||
if (auto request = const_cast<Request*>(m_requests.get(message.request_id()).value_or(nullptr))) {
|
||||
request->did_request_certificates({});
|
||||
}
|
||||
|
||||
return make<Messages::RequestClient::CertificateRequestedResponse>();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
template RefPtr<Protocol::Request> Protocol::RequestClient::start_request(const String& method, const String& url, const HashMap<String, String>& request_headers, ReadonlyBytes request_body);
|
||||
template RefPtr<Protocol::Request> Protocol::RequestClient::start_request(const String& method, const String& url, const HashMap<String, String, CaseInsensitiveStringTraits>& request_headers, ReadonlyBytes request_body);
|
44
Userland/Libraries/LibProtocol/RequestClient.h
Normal file
44
Userland/Libraries/LibProtocol/RequestClient.h
Normal file
|
@ -0,0 +1,44 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/HashMap.h>
|
||||
#include <LibIPC/ServerConnection.h>
|
||||
#include <RequestServer/RequestClientEndpoint.h>
|
||||
#include <RequestServer/RequestServerEndpoint.h>
|
||||
|
||||
namespace Protocol {
|
||||
|
||||
class Request;
|
||||
|
||||
class RequestClient
|
||||
: public IPC::ServerConnection<RequestClientEndpoint, RequestServerEndpoint>
|
||||
, public RequestClientEndpoint {
|
||||
C_OBJECT(RequestClient);
|
||||
|
||||
public:
|
||||
virtual void handshake() override;
|
||||
|
||||
bool is_supported_protocol(const String&);
|
||||
template<typename RequestHashMapTraits = Traits<String>>
|
||||
RefPtr<Request> start_request(const String& method, const String& url, const HashMap<String, String, RequestHashMapTraits>& request_headers = {}, ReadonlyBytes request_body = {});
|
||||
|
||||
bool stop_request(Badge<Request>, Request&);
|
||||
bool set_certificate(Badge<Request>, Request&, String, String);
|
||||
|
||||
private:
|
||||
RequestClient();
|
||||
|
||||
virtual void handle(const Messages::RequestClient::RequestProgress&) override;
|
||||
virtual void handle(const Messages::RequestClient::RequestFinished&) override;
|
||||
virtual OwnPtr<Messages::RequestClient::CertificateRequestedResponse> handle(const Messages::RequestClient::CertificateRequested&) override;
|
||||
virtual void handle(const Messages::RequestClient::HeadersBecameAvailable&) override;
|
||||
|
||||
HashMap<i32, RefPtr<Request>> m_requests;
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue