mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 08:57:47 +00:00
LibCore: Move Stream-based sockets into the Core
namespace
This commit is contained in:
parent
d43a7eae54
commit
a96339b72b
123 changed files with 1157 additions and 1100 deletions
|
@ -92,10 +92,10 @@ Job::Job(HttpRequest&& request, AK::Stream& output_stream)
|
|||
{
|
||||
}
|
||||
|
||||
void Job::start(Core::Stream::Socket& socket)
|
||||
void Job::start(Core::Socket& socket)
|
||||
{
|
||||
VERIFY(!m_socket);
|
||||
m_socket = static_cast<Core::Stream::BufferedSocketBase*>(&socket);
|
||||
m_socket = static_cast<Core::BufferedSocketBase*>(&socket);
|
||||
dbgln_if(HTTPJOB_DEBUG, "Reusing previous connection for {}", url());
|
||||
deferred_invoke([this] {
|
||||
dbgln_if(HTTPJOB_DEBUG, "HttpJob: on_connected callback");
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
#include <AK/NonnullOwnPtrVector.h>
|
||||
#include <AK/Optional.h>
|
||||
#include <LibCore/NetworkJob.h>
|
||||
#include <LibCore/Socket.h>
|
||||
#include <LibHTTP/HttpRequest.h>
|
||||
#include <LibHTTP/HttpResponse.h>
|
||||
|
||||
|
@ -22,10 +23,10 @@ public:
|
|||
explicit Job(HttpRequest&&, AK::Stream&);
|
||||
virtual ~Job() override = default;
|
||||
|
||||
virtual void start(Core::Stream::Socket&) override;
|
||||
virtual void start(Core::Socket&) override;
|
||||
virtual void shutdown(ShutdownMode) override;
|
||||
|
||||
Core::Stream::Socket const* socket() const { return m_socket; }
|
||||
Core::Socket const* socket() const { return m_socket; }
|
||||
URL url() const { return m_request.url(); }
|
||||
|
||||
HttpResponse* response() { return static_cast<HttpResponse*>(Core::NetworkJob::response()); }
|
||||
|
@ -50,7 +51,7 @@ protected:
|
|||
|
||||
HttpRequest m_request;
|
||||
State m_state { State::InStatus };
|
||||
Core::Stream::BufferedSocketBase* m_socket { nullptr };
|
||||
Core::BufferedSocketBase* m_socket { nullptr };
|
||||
bool m_legacy_connection { false };
|
||||
int m_code { -1 };
|
||||
HashMap<DeprecatedString, DeprecatedString, CaseInsensitiveStringTraits> m_headers;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue