MCPcopy Create free account
hub / github.com/apache/trafficserver / Get_Response

Function Get_Response

src/traffic_cache_tool/CacheTool.cc:1296–1330  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1294}
1295
1296void
1297Get_Response(swoc::file::path const &input_file_path)
1298{
1299 // scheme=http user=u password=p host=172.28.56.109 path=somepath query=somequery port=1234
1300 // input file format: scheme://hostname:port/somepath;params?somequery user=USER password=PASS
1301 // user, password, are optional; scheme and host are required
1302
1303 // char* h= http://user:pass@IPADDRESS/path_to_file;?port <== this is the format we need
1304
1305 Cache cache;
1306 if (!input_file_path.empty()) {
1307 printf("passed argv %s\n", input_file_path.c_str());
1308 }
1309 cache.loadURLs(input_file_path);
1310 if ((err = cache.loadSpan(SpanFile))) {
1311 cache.dumpSpans(Cache::SpanDumpDepth::SPAN);
1312 cache.build_stripe_hash_table();
1313 for (auto host : cache.URLset) {
1314 CryptoContext ctx;
1315 CryptoHash hashT;
1316 swoc::LocalBufferWriter<33> w;
1317 ctx.update(host->url.data(), host->url.size());
1318 ctx.update(&host->port, sizeof(host->port));
1319 ctx.finalize(hashT);
1320 StripeSM *stripe_ = cache.key_to_stripe(&hashT, host->url.data(), host->url.size());
1321 w.print("{}", hashT);
1322 printf("hash of %.*s is %.*s: Stripe %s \n", static_cast<int>(host->url.size()), host->url.data(),
1323 static_cast<int>(w.size()), w.data(), stripe_->hashText.data());
1324 CacheDirEntry *dir_result = nullptr;
1325 stripe_->loadMeta();
1326 stripe_->loadDir();
1327 stripe_->dir_probe(&hashT, dir_result, nullptr);
1328 }
1329 }
1330}
1331
1332void static scan_span(Span *span, swoc::file::path const &regex_path)
1333{

Callers 1

mainFunction · 0.85

Calls 15

loadURLsMethod · 0.80
loadSpanMethod · 0.80
dumpSpansMethod · 0.80
loadMetaMethod · 0.80
loadDirMethod · 0.80
dir_probeMethod · 0.80
emptyMethod · 0.45
c_strMethod · 0.45
updateMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected