Definition at line 63 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 |
( |
| ) |
|
◆ 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 96 of file Chunked.cpp.
96 {
97 std::size_t consumed = 0;
98 std::size_t ret = 0;
99 std::size_t pos = 0;
100
101 const static int maxChunkLenTotalS = sizeof(std::size_t) * 2;
102
104 case -1:
110
113
115
116 [[fallthrough]];
117 case 0:
118 do {
119 char ch = '\0';
120
122 if (ret > 0) {
123 consumed++;
124
126 if (ch == '\n') {
128 } else {
130 }
131 } else if (ch == '\r') {
133 } else {
135 }
136 }
138
141
144 }
145
146 break;
147 }
148
151
152 try {
155
157 } catch (std::invalid_argument&) {
159 break;
160 }
161
162 [[fallthrough]];
163 case 1:
164 do {
167 consumed += ret;
169
171 break;
172 }
173
175
176 [[fallthrough]];
177 case 2:
178 char ch = '\0';
179
181 consumed += ret;
182
183 if (ret > 0) {
184 if (
CR || ch ==
'\r') {
185 if (
CR && ch ==
'\n') {
192 } else {
194 }
195 } else {
198 }
199 }
200
201 break;
202 }
203
204 return consumed;
205 }
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 chunk, chunkLenRead, chunkLenTotal, chunkLenTotalS, completed, CR, error, LF, core::socket::stream::SocketContext::readFromPeer(), and state.
Referenced by web::http::decoder::Chunked::read().
◆ 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: