SNode.C
Loading...
Searching...
No Matches
web::http::decoder::HTTP10Response Class Reference

#include <HTTP10Response.h>

Inheritance diagram for web::http::decoder::HTTP10Response:
Collaboration diagram for web::http::decoder::HTTP10Response:

Public Member Functions

 HTTP10Response (const core::socket::stream::SocketContext *socketContext)
 
 HTTP10Response (const HTTP10Response &)=delete
 
 HTTP10Response (HTTP10Response &&) noexcept=default
 
HTTP10Responseoperator= (const HTTP10Response &)=delete
 
HTTP10Responseoperator= (HTTP10Response &&) noexcept=default
 
 ~HTTP10Response () override
 
- Public Member Functions inherited from web::http::ContentDecoder
 ContentDecoder ()=default
 
 ContentDecoder (const ContentDecoder &)=delete
 
 ContentDecoder (ContentDecoder &&) noexcept=default
 
ContentDecoderoperator= (const ContentDecoder &)=delete
 
ContentDecoderoperator= (ContentDecoder &&) noexcept=default
 
virtual ~ContentDecoder ()
 
bool isComplete () const
 
bool isError () const
 
std::vector< char > && getContent ()
 

Private Member Functions

std::size_t read () override
 

Private Attributes

const core::socket::stream::SocketContextsocketContext
 
std::size_t contentLengthRead = 0
 

Additional Inherited Members

- Protected Attributes inherited from web::http::ContentDecoder
std::vector< char > content
 
bool completed = false
 
bool error = false
 

Detailed Description

Definition at line 59 of file HTTP10Response.h.

Constructor & Destructor Documentation

◆ HTTP10Response() [1/3]

web::http::decoder::HTTP10Response::HTTP10Response ( const core::socket::stream::SocketContext socketContext)
explicit

Definition at line 58 of file HTTP10Response.cpp.

60 }
const core::socket::stream::SocketContext * socketContext

References socketContext.

Referenced by web::http::Parser::analyzeHeader().

Here is the caller graph for this function:

◆ HTTP10Response() [2/3]

web::http::decoder::HTTP10Response::HTTP10Response ( const HTTP10Response )
delete

◆ HTTP10Response() [3/3]

web::http::decoder::HTTP10Response::HTTP10Response ( HTTP10Response &&  )
defaultnoexcept

◆ ~HTTP10Response()

web::http::decoder::HTTP10Response::~HTTP10Response ( )
override

Definition at line 62 of file HTTP10Response.cpp.

62 {
63 }

Member Function Documentation

◆ operator=() [1/2]

HTTP10Response & web::http::decoder::HTTP10Response::operator= ( const HTTP10Response )
delete

◆ operator=() [2/2]

HTTP10Response & web::http::decoder::HTTP10Response::operator= ( HTTP10Response &&  )
defaultnoexcept

◆ read()

std::size_t web::http::decoder::HTTP10Response::read ( )
overrideprivatevirtual

Implements web::http::ContentDecoder.

Definition at line 65 of file HTTP10Response.cpp.

65 {
66 std::size_t consumed = 0;
67 std::size_t ret = 0;
68 static char contentChunk[MAX_CONTENT_CHUNK_LEN];
69
70 do {
72 contentLengthRead += ret;
73 consumed += ret;
74
75 content.insert(content.end(), contentChunk, contentChunk + ret);
76 } while (ret > 0);
77
78 return consumed;
79 }
#define MAX_CONTENT_CHUNK_LEN
std::size_t readFromPeer(char *chunk, std::size_t chunklen) const final
std::vector< char > content

References web::http::ContentDecoder::content, contentLengthRead, core::socket::stream::SocketContext::readFromPeer(), and socketContext.

Here is the call graph for this function:

Member Data Documentation

◆ contentLengthRead

std::size_t web::http::decoder::HTTP10Response::contentLengthRead = 0
private

Definition at line 75 of file HTTP10Response.h.

Referenced by read().

◆ socketContext

const core::socket::stream::SocketContext* web::http::decoder::HTTP10Response::socketContext
private

Definition at line 73 of file HTTP10Response.h.

Referenced by HTTP10Response(), and read().


The documentation for this class was generated from the following files: