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

Function DoraXrtHttpStreamConsume

Source/Http/XrtHttpClient.c:219–233  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

217}
218
219static void DoraXrtHttpStreamConsume(DoraXrtHttpStreamContext* ctx, size_t len) {
220 if (!ctx || len == 0u) {
221 return;
222 }
223 if (len >= ctx->pendingLen) {
224 ctx->pendingLen = 0u;
225 if (ctx->pending) {
226 ctx->pending[0] = '\0';
227 }
228 return;
229 }
230 memmove(ctx->pending, ctx->pending + len, ctx->pendingLen - len);
231 ctx->pendingLen -= len;
232 ctx->pending[ctx->pendingLen] = '\0';
233}
234
235static size_t DoraXrtHttpFindBytes(const char* data, size_t len, const char* needle, size_t needleLen) {
236 if (!data || !needle || needleLen == 0u || len < needleLen) {

Calls 1

memmoveFunction · 0.85

Tested by

no test coverage detected