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

Method findBasicAuthChallenge

Libraries/HttpClient/HttpClientSession.cpp:789–809  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

787 }
788 if (target == nullptr and not entry.isInUse())
789 {
790 target = &entry;
791 }
792 }
793
794 SC_TRY_MSG(target != nullptr, "HttpClientSession: auth cache capacity exhausted");
795 const StringSpan sources[] = {origin, authorizationHeader};
796 StringSpan destinations[2];
797 SC_TRY(copyStateStrings(sources, destinations));
798 target->origin = destinations[0];
799 target->authorizationHeader = destinations[1];
800 return Result(true);
801}
802
803bool SC::HttpClientSession::findAuthorization(StringSpan origin, StringSpan& authorizationHeader) const
804{
805 authorizationHeader = {};
806 if (not initialized)
807 {
808 return false;
809 }
810
811 for (size_t idx = 0; idx < sessionMemory.authEntries.sizeInElements(); ++idx)
812 {

Callers

nothing calls this directly

Calls 3

StringSpanFunction · 0.85
findNextHeaderMethod · 0.80

Tested by

no test coverage detected