MCPcopy Create free account
hub / github.com/IppClub/Dora-SSR / DoraXrtHttpProcessFixedBody

Function DoraXrtHttpProcessFixedBody

Source/Http/XrtHttpClient.c:520–534  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

518}
519
520static int DoraXrtHttpProcessFixedBody(DoraXrtHttpStreamContext* ctx) {
521 while (ctx->pendingLen > 0u && ctx->received < ctx->contentLength) {
522 size_t remain = ctx->contentLength - ctx->received;
523 size_t take = ctx->pendingLen < remain ? ctx->pendingLen : remain;
524 ctx->received += take;
525 if (!DoraXrtHttpDeliverChunk(ctx, ctx->pending, take, ctx->contentLength)) {
526 return 0;
527 }
528 DoraXrtHttpStreamConsume(ctx, take);
529 }
530 if (ctx->received >= ctx->contentLength) {
531 DoraXrtHttpStreamCloseWith(ctx, XRT_NET_OK);
532 }
533 return 1;
534}
535
536static int DoraXrtHttpParseChunkSize(const char* line, size_t len, size_t* outSize) {
537 size_t value = 0u;

Callers 1

DoraXrtHttpStreamProcessFunction · 0.85

Calls 3

DoraXrtHttpDeliverChunkFunction · 0.85
DoraXrtHttpStreamConsumeFunction · 0.85

Tested by

no test coverage detected