20 #include <ripple/beast/net/IPEndpoint.h>
21 #include <boost/algorithm/string.hpp>
42 if (!is.
fail() && is.
rdbuf()->in_avail() == 0)
101 addrStr.
reserve(INET6_ADDRSTRLEN);
110 while (is && is.
rdbuf()->in_avail() > 0 && is.
get(i))
117 if (isspace(
static_cast<unsigned char>(i)) || (readTo && i == readTo))
120 if ((i ==
'.') || (i >=
'0' && i <=
':') || (i >=
'a' && i <=
'f') ||
121 (i >=
'A' && i <=
'F'))
126 if (addrStr.
size() == INET6_ADDRSTRLEN ||
127 (readTo && readTo ==
':' && addrStr.
size() > 15))
129 is.
setstate(std::ios_base::failbit);
133 if (!readTo && (i ==
'.' || i ==
':'))
137 readTo = (i ==
'.') ?
':' :
' ';
143 is.
setstate(std::ios_base::failbit);
148 if (readTo ==
']' && is.
rdbuf()->in_avail() > 0)
151 if (!(isspace(
static_cast<unsigned char>(i)) || i ==
':'))
154 is.
setstate(std::ios_base::failbit);
159 boost::system::error_code ec;
160 auto addr = Address::from_string(addrStr, ec);
163 is.
setstate(std::ios_base::failbit);
167 if (is.
rdbuf()->in_avail() > 0)