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

Method findNextHeader

Libraries/HttpClient/HttpClient.cpp:957–972  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

955}
956
957SC::Result SC::HttpClientContentCoding::writeAcceptEncoding(Span<const Type> types, Span<char> destination,
958 StringSpan& value)
959{
960 if (types.empty())
961 return Result::Error(HttpClientResultCategory, HttpClientError::ContentCodingListEmpty);
962
963 size_t usedBytes = 0;
964 for (size_t idx = 0; idx < types.sizeInElements(); ++idx)
965 {
966 if (types[idx] == Unknown)
967 return Result::Error(HttpClientResultCategory, HttpClientError::ContentCodingUnknown);
968
969 const char* const name = getName(types[idx]);
970 const size_t nameBytes = strlen(name);
971 const size_t sepBytes = idx == 0 ? 0 : 2;
972 if (destination.sizeInBytes() - usedBytes < sepBytes + nameBytes)
973 return Result::Error(HttpClientResultCategory, HttpClientError::AcceptEncodingOutputTooSmall);
974
975 if (sepBytes > 0)

Callers 3

responseHeaderHelpersMethod · 0.80
captureResponseMethod · 0.80

Calls 1

asciiEqualsIgnoreCaseFunction · 0.85

Tested by 1

responseHeaderHelpersMethod · 0.64