diff options
| author | Garrett D'Amore <garrett@damore.org> | 2019-12-27 01:06:35 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2019-12-27 01:06:35 -0800 |
| commit | c590be7c6ead811f929041393a061e4068f35b00 (patch) | |
| tree | 967b495c0a0865996f2b849b6b475a4beb67a1a0 /src/platform/windows | |
| parent | 1bb46ca346e666fd9c60e7be06ef7a1c927ca2f1 (diff) | |
| download | nng-c590be7c6ead811f929041393a061e4068f35b00.tar.gz nng-c590be7c6ead811f929041393a061e4068f35b00.tar.bz2 nng-c590be7c6ead811f929041393a061e4068f35b00.zip | |
fixes #1051 nni_ntop is unused
Diffstat (limited to 'src/platform/windows')
| -rw-r--r-- | src/platform/windows/win_resolv.c | 43 |
1 files changed, 1 insertions, 42 deletions
diff --git a/src/platform/windows/win_resolv.c b/src/platform/windows/win_resolv.c index e01dba3b..53a39118 100644 --- a/src/platform/windows/win_resolv.c +++ b/src/platform/windows/win_resolv.c @@ -1,5 +1,5 @@ // -// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech> +// Copyright 2019 Staysail Systems, Inc. <info@staysail.tech> // Copyright 2018 Capitar IT Group BV <info@capitar.com> // // This software is supplied under the terms of the MIT License, a @@ -308,47 +308,6 @@ resolv_worker(void *notused) } int -nni_ntop(const nni_sockaddr *sa, char *ipstr, char *portstr) -{ - void * ap; - uint16_t port; - int af; - switch (sa->s_family) { - case NNG_AF_INET: - ap = (void *) &sa->s_in.sa_addr; - port = sa->s_in.sa_port; - af = AF_INET; - break; - case NNG_AF_INET6: - ap = (void *) &sa->s_in6.sa_addr; - port = sa->s_in6.sa_port; - af = AF_INET6; - break; - default: - return (NNG_EINVAL); - } - if (ipstr != NULL) { - if (af == AF_INET6) { - size_t l; - ipstr[0] = '['; - InetNtopA(af, ap, ipstr + 1, INET6_ADDRSTRLEN); - l = strlen(ipstr); - ipstr[l++] = ']'; - ipstr[l++] = '\0'; - } else { - InetNtopA(af, ap, ipstr, INET6_ADDRSTRLEN); - } - } - if (portstr != NULL) { -#ifdef NNG_LITTLE_ENDIAN - port = ((port >> 8) & 0xff) | ((port & 0xff) << 8); -#endif - snprintf(portstr, 6, "%u", port); - } - return (0); -} - -int nni_win_resolv_sysinit(void) { nni_mtx_init(&resolv_mtx); |
