MCPcopy Create free account
hub / github.com/BlueAndi/Pixelix / parseChunkedResponseChunkData

Method parseChunkedResponseChunkData

lib/AsyncHttpClient/src/AsyncHttpClient.cpp:1295–1332  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1293}
1294
1295bool AsyncHttpClient::parseChunkedResponseChunkData(const uint8_t* data, size_t len, size_t& index)
1296{
1297 size_t available = len - index;
1298 size_t needed = m_chunkSize - m_chunkIndex;
1299 size_t copySize = 0U;
1300 bool isDataEOF = false;
1301
1302 if (available >= needed)
1303 {
1304 copySize = needed;
1305 }
1306 else
1307 {
1308 copySize = available;
1309 }
1310
1311 if (false == m_rsp.addPayload(&data[index], copySize))
1312 {
1313 LOG_FATAL("Couldn't add chunk payload.");
1314
1315 /* Abort by set EOF. */
1316 m_chunkIndex = 0U;
1317 isDataEOF = true;
1318 }
1319 else
1320 {
1321 index += copySize;
1322 m_chunkIndex += copySize;
1323
1324 if (m_chunkSize <= m_chunkIndex)
1325 {
1326 m_chunkIndex = 0U;
1327 isDataEOF = true;
1328 }
1329 }
1330
1331 return isDataEOF;
1332}
1333
1334bool AsyncHttpClient::parseChunkedResponseChunkDataEnd(const char* data, size_t len, size_t& index)
1335{

Callers

nothing calls this directly

Calls 1

addPayloadMethod · 0.80

Tested by

no test coverage detected