MCPcopy Create free account
hub / github.com/Pagghiu/SaneCppLibraries / parseHeaderName

Method parseHeaderName

Libraries/Http/HttpParser.cpp:577–613  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

575}
576
577bool SC::HttpParser::parseHeaderName(char currentChar)
578{
579 SC_CO_BEGIN(nestedParserCoroutine);
580 matchIndex = 0;
581 for (size_t idx = 0; idx < numMatches; ++idx)
582 {
583 matchingHeader[idx] = SC_HTTP_TRACKED_HEADERS[idx].sizeInBytes();
584 matchingHeaderValid[idx] = false;
585 }
586 while (currentChar != ':')
587 {
588 for (size_t idx = 0; idx < numMatches; ++idx)
589 {
590 if (matchingHeader[idx] == 0)
591 continue;
592 if (scHttpToLowerAscii(SC_HTTP_TRACKED_HEADERS[idx].bytesIncludingTerminator()[matchIndex]) ==
593 scHttpToLowerAscii(currentChar))
594 {
595 matchingHeader[idx] -= 1;
596 if (matchingHeader[idx] == 0)
597 {
598 matchingHeaderValid[idx] = true;
599 }
600 }
601 else
602 {
603 matchingHeader[idx] = 0;
604 }
605 }
606 matchIndex += 1;
607 SC_CO_RETURN(nestedParserCoroutine, true);
608 }
609 state = State::Result;
610 tokenLength--;
611 SC_CO_FINISH(nestedParserCoroutine);
612 return true;
613}
614
615bool SC::HttpParser::parseHeaderValue(char currentChar)
616{

Callers

nothing calls this directly

Calls 2

scHttpToLowerAsciiFunction · 0.85
sizeInBytesMethod · 0.45

Tested by

no test coverage detected