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

Function DoraXrtHttpStreamOnClose

Source/Http/XrtHttpClient.c:718–743  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

716}
717
718static void DoraXrtHttpStreamOnClose(ptr owner, xnetstream* stream, xnet_result reason) {
719 DoraXrtHttpStreamContext* ctx = (DoraXrtHttpStreamContext*)owner;
720 xnet_result status;
721 (void)stream;
722 if (!ctx) {
723 return;
724 }
725 if (ctx->finalStatus == XRT_NET_AGAIN) {
726 (void)DoraXrtHttpStreamProcess(ctx);
727 }
728 if (ctx->finalStatus == XRT_NET_AGAIN) {
729 if (ctx->streamError) {
730 status = XRT_NET_ERROR;
731 } else if (!ctx->headerParsed) {
732 status = reason == XRT_NET_CANCELLED ? XRT_NET_CANCELLED : XRT_NET_ERROR;
733 } else if (ctx->bodyMode == DORA_XRT_HTTP_BODY_CHUNKED) {
734 status = XRT_NET_ERROR;
735 } else if (ctx->bodyMode == DORA_XRT_HTTP_BODY_CONTENT_LENGTH && ctx->received < ctx->contentLength) {
736 status = XRT_NET_ERROR;
737 } else {
738 status = XRT_NET_OK;
739 }
740 ctx->finalStatus = status;
741 }
742 DoraXrtHttpStreamResolve(ctx, ctx->finalStatus);
743}
744
745static void DoraXrtHttpStreamOnError(ptr owner, xnetstream* stream, int sysErr) {
746 (void)stream;

Callers

nothing calls this directly

Calls 2

DoraXrtHttpStreamProcessFunction · 0.85
DoraXrtHttpStreamResolveFunction · 0.85

Tested by

no test coverage detected