mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-06 02:55:49 +03:00
0dc9af5f7e
Also run it across the whole tree to get everything using the One True Style. We don't yet run this in an automated fashion as it's a little slow, but there is a snippet to do so in makeall.sh.
35 lines
686 B
C++
35 lines
686 B
C++
#pragma once
|
|
|
|
#include <AK/HashMap.h>
|
|
#include <LibCore/CHttpRequest.h>
|
|
#include <LibCore/CNetworkJob.h>
|
|
|
|
class CTCPSocket;
|
|
|
|
class CHttpJob final : public CNetworkJob {
|
|
public:
|
|
explicit CHttpJob(const CHttpRequest&);
|
|
virtual ~CHttpJob() override;
|
|
|
|
virtual void start() override;
|
|
|
|
virtual const char* class_name() const override { return "CHttpJob"; }
|
|
|
|
private:
|
|
void on_socket_connected();
|
|
|
|
enum class State
|
|
{
|
|
InStatus,
|
|
InHeaders,
|
|
InBody,
|
|
Finished,
|
|
};
|
|
|
|
CHttpRequest m_request;
|
|
CTCPSocket* m_socket { nullptr };
|
|
State m_state { State::InStatus };
|
|
int m_code { -1 };
|
|
HashMap<String, String> m_headers;
|
|
};
|