From 04b9dc2d30cfc9b383029f6a4b02e2725108b0ae Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 4 Jul 2019 16:16:50 +0200 Subject: Libraries: Create top level directory for libraries. Things were getting a little crowded in the project root, so this patch moves the Lib*/ directories into Libraries/. --- Libraries/LibCore/CHttpJob.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 Libraries/LibCore/CHttpJob.h (limited to 'Libraries/LibCore/CHttpJob.h') diff --git a/Libraries/LibCore/CHttpJob.h b/Libraries/LibCore/CHttpJob.h new file mode 100644 index 0000000000..5b714a7f77 --- /dev/null +++ b/Libraries/LibCore/CHttpJob.h @@ -0,0 +1,33 @@ +#pragma once + +#include +#include +#include + +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 m_headers; +}; -- cgit v1.2.3