net/ToString: rename sockaddr_to_string() to ToString()

This commit is contained in:
Max Kellermann 2015-07-22 10:20:57 +02:00
parent 8fdfe85b5f
commit 83752e9349
6 changed files with 6 additions and 6 deletions

View File

@ -62,7 +62,7 @@ client_new(EventLoop &loop, Partition &partition,
int fd, SocketAddress address, int uid)
{
static unsigned int next_client_num;
const auto remote = sockaddr_to_string(address);
const auto remote = ToString(address);
assert(fd >= 0);

View File

@ -112,7 +112,7 @@ public:
gcc_pure
std::string ToString() const {
return sockaddr_to_string(address);
return ::ToString(address);
}
void SetFD(int _fd) {

View File

@ -102,7 +102,7 @@ UnmapV4(SocketAddress src, struct sockaddr_in &buffer)
#endif
std::string
sockaddr_to_string(SocketAddress address)
ToString(SocketAddress address)
{
#ifdef HAVE_UN
if (address.GetFamily() == AF_UNIX)

View File

@ -33,6 +33,6 @@ class SocketAddress;
*/
gcc_pure
std::string
sockaddr_to_string(SocketAddress address);
ToString(SocketAddress address);
#endif

View File

@ -209,7 +209,7 @@ HttpdOutput::OnAccept(int fd, SocketAddress address, gcc_unused int uid)
#ifdef HAVE_LIBWRAP
if (address.GetFamily() != AF_UNIX) {
const auto hostaddr = sockaddr_to_string(address);
const auto hostaddr = ToString(address);
// TODO: shall we obtain the program name from argv[0]?
const char *progname = "mpd";

View File

@ -52,7 +52,7 @@ int main(int argc, char **argv)
}
for (const struct addrinfo *i = ai; i != NULL; i = i->ai_next) {
const auto s = sockaddr_to_string({i->ai_addr, i->ai_addrlen});
const auto s = ToString({i->ai_addr, i->ai_addrlen});
printf("%s\n", s.c_str());
}