| 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 | |
| 803 | bool 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 | { |
nothing calls this directly
no test coverage detected