low level network primitives should not be exported. Moved enum_if into tests (since it uses internal functions)

This commit is contained in:
Arvid Norberg
2013-07-20 01:02:15 +00:00
parent 6e28e33b32
commit bbe62564ad
8 changed files with 41 additions and 34 deletions

View File

@@ -67,25 +67,15 @@ namespace libtorrent
std::string print_endpoint(tcp::endpoint const& ep)
{
error_code ec;
std::string ret;
char buf[200];
address const& addr = ep.address();
#if TORRENT_USE_IPV6
if (addr.is_v6())
{
ret += '[';
ret += addr.to_string(ec);
ret += ']';
ret += ':';
ret += to_string(ep.port()).elems;
}
snprintf(buf, sizeof(buf), "[%s]:%d", addr.to_string(ec).c_str(), ep.port());
else
#endif
{
ret += addr.to_string(ec);
ret += ':';
ret += to_string(ep.port()).elems;
}
return ret;
snprintf(buf, sizeof(buf), "%s:%d", addr.to_string(ec).c_str(), ep.port());
return buf;
}
std::string print_endpoint(udp::endpoint const& ep)