| 575 | } |
| 576 | |
| 577 | bool 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 | |
| 615 | bool SC::HttpParser::parseHeaderValue(char currentChar) |
| 616 | { |
nothing calls this directly
no test coverage detected