MCPcopy Create free account
hub / github.com/apache/brpc / GenerateH2Path

Method GenerateH2Path

src/brpc/uri.cpp:376–394  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

374}
375
376void URI::GenerateH2Path(std::string* h2_path) const {
377 h2_path->reserve(_path.size() + _query.size() + _fragment.size() + 3);
378 h2_path->clear();
379 if (_path.empty()) {
380 h2_path->push_back('/');
381 } else {
382 h2_path->append(_path);
383 }
384 if (_initialized_query_map && _query_was_modified) {
385 AppendQueryString(h2_path, true);
386 } else if (!_query.empty()) {
387 h2_path->push_back('?');
388 h2_path->append(_query);
389 }
390 if (!_fragment.empty()) {
391 h2_path->push_back('#');
392 h2_path->append(_fragment);
393 }
394}
395
396void URI::SetHostAndPort(const std::string& host) {
397 const char* const host_begin = host.c_str();

Callers 2

TESTFunction · 0.80
NewMethod · 0.80

Calls 6

reserveMethod · 0.45
sizeMethod · 0.45
clearMethod · 0.45
emptyMethod · 0.45
push_backMethod · 0.45
appendMethod · 0.45

Tested by 1

TESTFunction · 0.64