Definition at line 41 of file Chunked.h.
◆ Chunk() [1/3]
web::http::decoder::Chunked::Chunk::Chunk |
( |
| ) |
|
|
default |
◆ Chunk() [2/3]
web::http::decoder::Chunked::Chunk::Chunk |
( |
const Chunk & | | ) |
|
|
delete |
◆ Chunk() [3/3]
web::http::decoder::Chunked::Chunk::Chunk |
( |
Chunk && | | ) |
|
|
defaultnoexcept |
◆ ~Chunk()
web::http::decoder::Chunked::Chunk::~Chunk |
( |
| ) |
|
◆ begin()
std::vector< char >::iterator web::http::decoder::Chunked::Chunk::begin |
( |
| ) |
|
Definition at line 193 of file Chunked.cpp.
193 {
194 return chunk.begin();
195 }
std::vector< char > chunk
◆ end()
std::vector< char >::iterator web::http::decoder::Chunked::Chunk::end |
( |
| ) |
|
◆ isComplete()
bool web::http::decoder::Chunked::Chunk::isComplete |
( |
| ) |
const |
|
inline |
◆ isError()
bool web::http::decoder::Chunked::Chunk::isError |
( |
| ) |
const |
|
inline |
◆ operator=() [1/2]
Chunk & web::http::decoder::Chunked::Chunk::operator= |
( |
Chunk && | | ) |
|
|
defaultnoexcept |
◆ operator=() [2/2]
Chunk & web::http::decoder::Chunked::Chunk::operator= |
( |
const Chunk & | | ) |
|
|
delete |
◆ read()
Definition at line 74 of file Chunked.cpp.
74 {
75 std::size_t consumed = 0;
76 std::size_t ret = 0;
77 std::size_t pos = 0;
78
79 const static int maxChunkLenTotalS = sizeof(std::size_t) * 2;
80
82 case -1:
88
91
93
94 [[fallthrough]];
95 case 0:
96 do {
97 char ch = '\0';
98
100 if (ret > 0) {
101 consumed++;
102
104 if (ch == '\n') {
106 } else {
108 }
109 } else if (ch == '\r') {
111 } else {
113 }
114 }
116
119
122 }
123
124 break;
125 }
126
129
130 try {
133
135 } catch (std::invalid_argument&) {
137 break;
138 }
139
140 [[fallthrough]];
141 case 1:
142 do {
145 consumed += ret;
147
149 break;
150 }
151
153
154 [[fallthrough]];
155 case 2:
156 char ch = '\0';
157
159 consumed += ret;
160
161 if (ret > 0) {
162 if (
CR || ch ==
'\r') {
163 if (
CR && ch ==
'\n') {
170 } else {
172 }
173 } else {
176 }
177 }
178
179 break;
180 }
181
182 return consumed;
183 }
std::size_t readFromPeer(char *chunk, std::size_t chunklen) const final
std::string chunkLenTotalS
std::size_t chunkLenTotal
const core::socket::stream::SocketContext * socketContext
References chunkLenRead, chunkLenTotal, chunkLenTotalS, completed, CR, error, LF, core::socket::stream::SocketContext::readFromPeer(), and state.
◆ size()
std::size_t web::http::decoder::Chunked::Chunk::size |
( |
| ) |
|
◆ chunk
std::vector<char> web::http::decoder::Chunked::Chunk::chunk |
|
private |
◆ chunkLenRead
std::size_t web::http::decoder::Chunked::Chunk::chunkLenRead = 0 |
|
private |
◆ chunkLenTotal
std::size_t web::http::decoder::Chunked::Chunk::chunkLenTotal = 0 |
|
private |
◆ chunkLenTotalS
std::string web::http::decoder::Chunked::Chunk::chunkLenTotalS |
|
private |
◆ completed
bool web::http::decoder::Chunked::Chunk::completed = false |
|
private |
◆ CR
bool web::http::decoder::Chunked::Chunk::CR = false |
|
private |
◆ error
bool web::http::decoder::Chunked::Chunk::error = false |
|
private |
◆ LF
bool web::http::decoder::Chunked::Chunk::LF = false |
|
private |
◆ state
int web::http::decoder::Chunked::Chunk::state = 0 |
|
private |
The documentation for this class was generated from the following files: