[2/2] os_support: Remove the dynamic loading of getaddrinfo from the fallback getaddrinfo

Message ID 20170531102143.2261-2-martin@martin.st
State Committed
Commit 2ca759657bcda328acc312e5882a940333a3e268
Headers show

Commit Message

Martin Storsjö May 31, 2017, 10:21 a.m.
If we for some unexplicable reason didn't pick up getaddrinfo
at configure, the default, IPv4-only, fallback should be good enough.

This effectively reverts 6023d84a2b7.
---
 libavformat/os_support.c | 31 -------------------------------
 1 file changed, 31 deletions(-)

Comments

Diego Biurrun May 31, 2017, 10:31 a.m. | #1
On Wed, May 31, 2017 at 01:21:43PM +0300, Martin Storsjö wrote:
> If we for some unexplicable reason didn't pick up getaddrinfo
> at configure, the default, IPv4-only, fallback should be good enough.
> 
> This effectively reverts 6023d84a2b7.
> ---
>  libavformat/os_support.c | 31 -------------------------------
>  1 file changed, 31 deletions(-)

probably OK

Diego

Patch

diff --git a/libavformat/os_support.c b/libavformat/os_support.c
index e9b1f88fb8..6a0c1fa7fc 100644
--- a/libavformat/os_support.c
+++ b/libavformat/os_support.c
@@ -74,16 +74,6 @@  int ff_getaddrinfo(const char *node, const char *service,
     struct addrinfo *ai;
     struct sockaddr_in *sin;
 
-#if HAVE_WINSOCK2_H
-    int (WSAAPI *win_getaddrinfo)(const char *node, const char *service,
-                                  const struct addrinfo *hints,
-                                  struct addrinfo **res);
-    HMODULE ws2mod = GetModuleHandle("ws2_32.dll");
-    win_getaddrinfo = GetProcAddress(ws2mod, "getaddrinfo");
-    if (win_getaddrinfo)
-        return win_getaddrinfo(node, service, hints, res);
-#endif /* HAVE_WINSOCK2_H */
-
     *res = NULL;
     sin  = av_mallocz(sizeof(struct sockaddr_in));
     if (!sin)
@@ -147,17 +137,6 @@  int ff_getaddrinfo(const char *node, const char *service,
 
 void ff_freeaddrinfo(struct addrinfo *res)
 {
-#if HAVE_WINSOCK2_H
-    void (WSAAPI *win_freeaddrinfo)(struct addrinfo *res);
-    HMODULE ws2mod = GetModuleHandle("ws2_32.dll");
-    win_freeaddrinfo = (void (WSAAPI *)(struct addrinfo *res))
-                       GetProcAddress(ws2mod, "freeaddrinfo");
-    if (win_freeaddrinfo) {
-        win_freeaddrinfo(res);
-        return;
-    }
-#endif /* HAVE_WINSOCK2_H */
-
     av_free(res->ai_canonname);
     av_free(res->ai_addr);
     av_free(res);
@@ -169,16 +148,6 @@  int ff_getnameinfo(const struct sockaddr *sa, int salen,
 {
     const struct sockaddr_in *sin = (const struct sockaddr_in *)sa;
 
-#if HAVE_WINSOCK2_H
-    int (WSAAPI *win_getnameinfo)(const struct sockaddr *sa, socklen_t salen,
-                                  char *host, DWORD hostlen,
-                                  char *serv, DWORD servlen, int flags);
-    HMODULE ws2mod = GetModuleHandle("ws2_32.dll");
-    win_getnameinfo = GetProcAddress(ws2mod, "getnameinfo");
-    if (win_getnameinfo)
-        return win_getnameinfo(sa, salen, host, hostlen, serv, servlen, flags);
-#endif /* HAVE_WINSOCK2_H */
-
     if (sa->sa_family != AF_INET)
         return EAI_FAMILY;
     if (!host && !serv)