| 217 | } |
| 218 | |
| 219 | static 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 | |
| 235 | static size_t DoraXrtHttpFindBytes(const char* data, size_t len, const char* needle, size_t needleLen) { |
| 236 | if (!data || !needle || needleLen == 0u || len < needleLen) { |
no test coverage detected