Webserv
Loading...
Searching...
No Matches
CGIHandler.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include "
network/ClientHandler.hpp
"
4
#include "
network/IEventHandler.hpp
"
5
6
namespace
network
{
7
8
class
CGIHandler
:
public
IEventHandler
{
9
public
:
10
CGIHandler
(
http::IResponseBody
&body,
ClientHandler
&client,
bool
hasHeaderParsing);
11
12
void
handleEvent
(uint32_t events);
13
int
getFd
()
const
;
14
15
private
:
16
enum
State
{
READING_HEADERS
,
STREAMING_BODY
,
COMPLETE
};
17
18
private
:
19
void
handleRead
();
20
21
private
:
22
http::IResponseBody
&
body_
;
23
ClientHandler
&
client_
;
24
std::string
headerBuffer_
;
25
State
state_
;
26
int
fd_
;
27
};
28
29
}
// namespace network
ClientHandler.hpp
IEventHandler.hpp
http::IResponseBody
An abstract interface for all HTTP response body sources.
Definition
ResponseBody.hpp:16
network::CGIHandler::client_
ClientHandler & client_
Definition
CGIHandler.hpp:23
network::CGIHandler::CGIHandler
CGIHandler(http::IResponseBody &body, ClientHandler &client, bool hasHeaderParsing)
Definition
CGIHandler.cpp:13
network::CGIHandler::handleRead
void handleRead()
Definition
CGIHandler.cpp:29
network::CGIHandler::fd_
int fd_
Definition
CGIHandler.hpp:26
network::CGIHandler::getFd
int getFd() const
Definition
CGIHandler.cpp:18
network::CGIHandler::State
State
Definition
CGIHandler.hpp:16
network::CGIHandler::READING_HEADERS
@ READING_HEADERS
Definition
CGIHandler.hpp:16
network::CGIHandler::COMPLETE
@ COMPLETE
Definition
CGIHandler.hpp:16
network::CGIHandler::STREAMING_BODY
@ STREAMING_BODY
Definition
CGIHandler.hpp:16
network::CGIHandler::body_
http::IResponseBody & body_
Definition
CGIHandler.hpp:22
network::CGIHandler::headerBuffer_
std::string headerBuffer_
Definition
CGIHandler.hpp:24
network::CGIHandler::state_
State state_
Definition
CGIHandler.hpp:25
network::CGIHandler::handleEvent
void handleEvent(uint32_t events)
Definition
CGIHandler.cpp:20
network::ClientHandler
Manages the full lifecycle of a single client connection.
Definition
ClientHandler.hpp:21
network::IEventHandler::IEventHandler
IEventHandler()
Definition
IEventHandler.cpp:5
network
Definition
Request.hpp:13
inc
network
CGIHandler.hpp
Generated by
1.14.0