| 518 | } |
| 519 | |
| 520 | static 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 | |
| 536 | static int DoraXrtHttpParseChunkSize(const char* line, size_t len, size_t* outSize) { |
| 537 | size_t value = 0u; |
no test coverage detected