MCPcopy Create free account
hub / github.com/IppClub/Dora-SSR / prepare_xrt_http_headers

Function prepare_xrt_http_headers

Source/Http/HttpServer.cpp:1075–1097  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1073}
1074
1075static void prepare_xrt_http_headers(
1076 std::vector<std::string>& headerNames,
1077 std::vector<std::string>& headerValues,
1078 std::vector<const char*>& headerNamePtrs,
1079 std::vector<const char*>& headerValuePtrs,
1080 const std::vector<std::pair<std::string, std::string>>& headers) {
1081 headerNames.clear();
1082 headerValues.clear();
1083 headerNamePtrs.clear();
1084 headerValuePtrs.clear();
1085 headerNames.reserve(headers.size() + 1);
1086 headerValues.reserve(headers.size() + 1);
1087 for (const auto& header : headers) {
1088 headerNames.push_back(header.first);
1089 headerValues.push_back(header.second);
1090 }
1091 headerNamePtrs.reserve(headerNames.size());
1092 headerValuePtrs.reserve(headerValues.size());
1093 for (size_t i = 0; i < headerNames.size(); ++i) {
1094 headerNamePtrs.push_back(headerNames[i].c_str());
1095 headerValuePtrs.push_back(headerValues[i].c_str());
1096 }
1097}
1098
1099struct XrtPostStreamCompletion {
1100 std::shared_ptr<HttpClient::ContentHandler> callback;

Callers 3

postAsyncMethod · 0.85
getAsyncMethod · 0.85
downloadAsyncMethod · 0.85

Calls 5

clearMethod · 0.65
reserveMethod · 0.45
sizeMethod · 0.45
push_backMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected