MCPcopy Create free account
hub / github.com/deathkiller/jazz2-native / CURLOnHeader

Method CURLOnHeader

Sources/Shared/IO/WebRequest.cpp:2596–2614  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2594 }
2595
2596 std::size_t WebResponseCURL::CURLOnHeader(const char* buffer, std::size_t size)
2597 {
2598 StringView hdr = StringView(buffer, size).trimmed();
2599
2600 if (hdr.hasPrefix("HTTP/"_s)) {
2601 // First line of the headers contains status text after version and status
2602 hdr = hdr.suffix(hdr.findOr(' ', hdr.end()).begin());
2603 _statusText = hdr.suffix(hdr.findOr(' ', hdr.end()).begin());
2604 _headers.clear();
2605 } else if (!hdr.empty()) {
2606 if (StringView sep = hdr.find(':')) {
2607 String hdrName = StringUtils::uppercase(hdr.prefix(sep.begin()).trimmedSuffix());
2608 String hdrValue = hdr.suffix(sep.end()).trimmedPrefix();
2609 _headers[hdrName].push_back(Death::move(hdrValue));
2610 }
2611 }
2612
2613 return size;
2614 }
2615
2616 std::int32_t WebResponseCURL::CURLOnProgress(curl_off_t total)
2617 {

Callers 1

CURLHeaderFunction · 0.80

Calls 14

uppercaseFunction · 0.85
trimmedMethod · 0.45
hasPrefixMethod · 0.45
suffixMethod · 0.45
beginMethod · 0.45
findOrMethod · 0.45
endMethod · 0.45
clearMethod · 0.45
emptyMethod · 0.45
findMethod · 0.45
trimmedSuffixMethod · 0.45
prefixMethod · 0.45

Tested by

no test coverage detected