MCPcopy Create free account
hub / github.com/Pagghiu/SaneCppLibraries / consumeBodyBytes

Method consumeBodyBytes

Libraries/Http/HttpConnection.cpp:431–444  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

429}
430
431Result HttpIncomingMessage::consumeBodyBytes(size_t bytes)
432{
433 if (bodyFramingKind != HttpBodyFramingKind::ContentLength)
434 {
435 return Result(true);
436 }
437 SC_TRY_MSG(bytes <= bodyBytesRemaining, "HttpIncomingMessage body exceeds Content-Length");
438 bodyBytesRemaining -= bytes;
439 if (bodyBytesRemaining == 0)
440 {
441 bodyComplete = true;
442 }
443 return Result(true);
444}
445
446Result HttpIncomingMessage::initBodyStream(AsyncBuffersPool& buffersPool, Function<Result()>&& onReadRequest)
447{

Callers 5

onDataMethod · 0.80
onPatchDataMethod · 0.80
onDataMethod · 0.80
onDataMethod · 0.80
onDataMethod · 0.80

Calls 1

ResultClass · 0.50

Tested by 5

onDataMethod · 0.64
onPatchDataMethod · 0.64
onDataMethod · 0.64
onDataMethod · 0.64
onDataMethod · 0.64