net/ToString: rename sockaddr_to_string() to ToString()
This commit is contained in:
parent
8fdfe85b5f
commit
83752e9349
@ -62,7 +62,7 @@ client_new(EventLoop &loop, Partition &partition,
|
|||||||
int fd, SocketAddress address, int uid)
|
int fd, SocketAddress address, int uid)
|
||||||
{
|
{
|
||||||
static unsigned int next_client_num;
|
static unsigned int next_client_num;
|
||||||
const auto remote = sockaddr_to_string(address);
|
const auto remote = ToString(address);
|
||||||
|
|
||||||
assert(fd >= 0);
|
assert(fd >= 0);
|
||||||
|
|
||||||
|
@ -112,7 +112,7 @@ public:
|
|||||||
|
|
||||||
gcc_pure
|
gcc_pure
|
||||||
std::string ToString() const {
|
std::string ToString() const {
|
||||||
return sockaddr_to_string(address);
|
return ::ToString(address);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetFD(int _fd) {
|
void SetFD(int _fd) {
|
||||||
|
@ -102,7 +102,7 @@ UnmapV4(SocketAddress src, struct sockaddr_in &buffer)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
std::string
|
std::string
|
||||||
sockaddr_to_string(SocketAddress address)
|
ToString(SocketAddress address)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_UN
|
#ifdef HAVE_UN
|
||||||
if (address.GetFamily() == AF_UNIX)
|
if (address.GetFamily() == AF_UNIX)
|
||||||
|
@ -33,6 +33,6 @@ class SocketAddress;
|
|||||||
*/
|
*/
|
||||||
gcc_pure
|
gcc_pure
|
||||||
std::string
|
std::string
|
||||||
sockaddr_to_string(SocketAddress address);
|
ToString(SocketAddress address);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -209,7 +209,7 @@ HttpdOutput::OnAccept(int fd, SocketAddress address, gcc_unused int uid)
|
|||||||
|
|
||||||
#ifdef HAVE_LIBWRAP
|
#ifdef HAVE_LIBWRAP
|
||||||
if (address.GetFamily() != AF_UNIX) {
|
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]?
|
// TODO: shall we obtain the program name from argv[0]?
|
||||||
const char *progname = "mpd";
|
const char *progname = "mpd";
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (const struct addrinfo *i = ai; i != NULL; i = i->ai_next) {
|
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());
|
printf("%s\n", s.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user