Commit b5e5972c authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

Update doc

parent 525d59fd
...@@ -762,6 +762,11 @@ std::string format_duration(const std::chrono::microseconds &u); ...@@ -762,6 +762,11 @@ std::string format_duration(const std::chrono::microseconds &u);
// Just like above, but this takes |t| as seconds. // Just like above, but this takes |t| as seconds.
std::string format_duration(double t); std::string format_duration(double t);
// The maximum buffer size including terminal NULL to store the result
// of make_hostport.
constexpr size_t max_hostport = NI_MAXHOST + /* [] for IPv6 */ 2 + /* : */ 1 +
/* port */ 5 + /* terminal NULL */ 1;
// Just like make_http_hostport(), but doesn't treat 80 and 443 // Just like make_http_hostport(), but doesn't treat 80 and 443
// specially. // specially.
StringRef make_hostport(BlockAllocator &balloc, const StringRef &host, StringRef make_hostport(BlockAllocator &balloc, const StringRef &host,
...@@ -798,9 +803,6 @@ StringRef make_hostport(OutputIt first, const StringRef &host, uint16_t port) { ...@@ -798,9 +803,6 @@ StringRef make_hostport(OutputIt first, const StringRef &host, uint16_t port) {
StringRef make_http_hostport(BlockAllocator &balloc, const StringRef &host, StringRef make_http_hostport(BlockAllocator &balloc, const StringRef &host,
uint16_t port); uint16_t port);
constexpr size_t max_hostport = NI_MAXHOST + /* [] for IPv6 */ 2 + /* : */ 1 +
/* port */ 5 + /* terminal NUL */ 1;
template <typename OutputIt> template <typename OutputIt>
StringRef make_http_hostport(OutputIt first, const StringRef &host, StringRef make_http_hostport(OutputIt first, const StringRef &host,
uint16_t port) { uint16_t port) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment