32 virtual ssize_t
read(
char *buffer,
size_t size) = 0;
40 virtual size_t size()
const = 0;
78 explicit FileBody(std::string
const &fpath);
81 ssize_t
read(
char *buffer,
size_t size);
95 ssize_t
read(
char *buffer,
size_t size);
108 ssize_t
read(
char *buffer,
size_t size);
~BodyFromCgi()
Definition ResponseBody.cpp:77
bool isDone() const
Checks if the body source has been fully read.
Definition ResponseBody.cpp:98
bool isDone_
Definition ResponseBody.hpp:117
bool hasHeaderParsing() const
Indicates if the data read from this source contains HTTP headers that need to be parsed by the serve...
Definition ResponseBody.cpp:100
ssize_t read(char *buffer, size_t size)
Reads a chunk of the body into the provided buffer. This is a non-blocking operation.
Definition ResponseBody.cpp:81
bool hasHeaderParsing_
Definition ResponseBody.hpp:118
size_t size() const
Returns the total size of the body in bytes, if known.
Definition ResponseBody.cpp:97
int fd_
Definition ResponseBody.hpp:116
BodyFromCgi(int pipeFd, bool hasHeaderParsing)
Definition ResponseBody.cpp:67
int getEventSourceFd() const
Retrieves the file descriptor for event-driven body sources.
Definition ResponseBody.cpp:99
size_t bytesRead_
Definition ResponseBody.hpp:101
std::string body_
Definition ResponseBody.hpp:100
bool isDone() const
Checks if the body source has been fully read.
Definition ResponseBody.cpp:55
size_t size() const
Returns the total size of the body in bytes, if known.
Definition ResponseBody.cpp:54
BodyInMemory(std::string const &)
Definition ResponseBody.cpp:52
ssize_t read(char *buffer, size_t size)
Reads a chunk of the body into the provided buffer. This is a non-blocking operation.
Definition ResponseBody.cpp:57
size_t sent_
Definition ResponseBody.hpp:88
ssize_t read(char *buffer, size_t size)
Reads a chunk of the body into the provided buffer. This is a non-blocking operation.
Definition ResponseBody.cpp:37
size_t size() const
Returns the total size of the body in bytes, if known.
Definition ResponseBody.cpp:45
FileBody(std::string const &fpath)
Definition ResponseBody.cpp:20
int fd_
Definition ResponseBody.hpp:86
~FileBody()
Definition ResponseBody.cpp:32
size_t size_
Definition ResponseBody.hpp:87
bool isDone() const
Checks if the body source has been fully read.
Definition ResponseBody.cpp:46
IResponseBody(IResponseBody const &)
virtual int getEventSourceFd() const
Retrieves the file descriptor for event-driven body sources.
Definition ResponseBody.cpp:16
virtual size_t size() const =0
Returns the total size of the body in bytes, if known.
virtual ssize_t read(char *buffer, size_t size)=0
Reads a chunk of the body into the provided buffer. This is a non-blocking operation.
virtual bool hasHeaderParsing() const
Indicates if the data read from this source contains HTTP headers that need to be parsed by the serve...
Definition ResponseBody.cpp:15
virtual bool isDone() const =0
Checks if the body source has been fully read.
IResponseBody const & operator=(IResponseBody const &)
virtual ~IResponseBody()
Definition ResponseBody.hpp:19
IResponseBody()
Definition ResponseBody.hpp:18
Definition IArgument.hpp:5