| 374 | } |
| 375 | |
| 376 | void 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 | |
| 396 | void URI::SetHostAndPort(const std::string& host) { |
| 397 | const char* const host_begin = host.c_str(); |