Lines Matching refs:hostport
1605 StringRef extract_host(const StringRef &hostport) {
1606 if (hostport[0] == '[') {
1608 auto p = std::find(std::begin(hostport), std::end(hostport), ']');
1609 if (p == std::end(hostport)) {
1612 if (p + 1 < std::end(hostport) && *(p + 1) != ':') {
1615 return StringRef{std::begin(hostport), p + 1};
1618 auto p = std::find(std::begin(hostport), std::end(hostport), ':');
1619 if (p == std::begin(hostport)) {
1622 return StringRef{std::begin(hostport), p};
1625 std::pair<StringRef, StringRef> split_hostport(const StringRef &hostport) {
1626 if (hostport.empty()) {
1629 if (hostport[0] == '[') {
1631 auto p = std::find(std::begin(hostport), std::end(hostport), ']');
1632 if (p == std::end(hostport)) {
1635 if (p + 1 == std::end(hostport)) {
1636 return {StringRef{std::begin(hostport) + 1, p}, {}};
1638 if (*(p + 1) != ':' || p + 2 == std::end(hostport)) {
1641 return {StringRef{std::begin(hostport) + 1, p},
1642 StringRef{p + 2, std::end(hostport)}};
1645 auto p = std::find(std::begin(hostport), std::end(hostport), ':');
1646 if (p == std::begin(hostport)) {
1649 if (p == std::end(hostport)) {
1650 return {StringRef{std::begin(hostport), p}, {}};
1652 if (p + 1 == std::end(hostport)) {
1656 return {StringRef{std::begin(hostport), p},
1657 StringRef{p + 1, std::end(hostport)}};