Commit 95a84cda authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Remove getnameinfo and getaddrinfo wrappers

They weren't thread-safe (and did not support IPv6).
parent c796d10a
...@@ -619,28 +619,9 @@ dnl getaddrinfo, getnameinfo and gai_strerror check ...@@ -619,28 +619,9 @@ dnl getaddrinfo, getnameinfo and gai_strerror check
dnl -lnsl and -lsocket are needed on Solaris; dnl -lnsl and -lsocket are needed on Solaris;
dnl we purposedly make the test fail on Windows dnl we purposedly make the test fail on Windows
LIBS_save="${LIBS}" LIBS_save="${LIBS}"
AH_TEMPLATE(HAVE_GETADDRINFO, [Define to 1 if you have the `getaddrinfo' function.]) AC_SEARCH_LIBS([getaddrinfo], [nsl],,, [${SOCKET_LIBS}])
AC_SEARCH_LIBS([getaddrinfo], [nsl], [AC_DEFINE(HAVE_GETADDRINFO)],, [${SOCKET_LIBS}])
dnl NOTE: we assume getaddrinfo will be present if getnameinfo or gai_strerro
dnl are
LIBS="${LIBS_gai}"
AC_CHECK_FUNCS([getnameinfo gai_strerror])
LIBS="${LIBS_save}" LIBS="${LIBS_save}"
AH_TEMPLATE(HAVE_ADDRINFO, [Define to 1 if <netdb.h> defines `struct addrinfo'.])
AC_CHECK_TYPES([struct addrinfo],[AC_DEFINE(HAVE_ADDRINFO)],,
[#include <sys/types.h>
#if defined( WIN32 ) || defined( UNDER_CE )
# if defined(UNDER_CE) && defined(sockaddr_storage)
# undef sockaddr_storage
# endif
# include <winsock2.h>
# include <ws2tcpip.h>
#else
# include <netdb.h>
#endif])
dnl Check for va_copy dnl Check for va_copy
AC_CACHE_CHECK([for va_copy], ac_cv_c_va_copy, AC_CACHE_CHECK([for va_copy], ac_cv_c_va_copy,
AC_TRY_LINK( AC_TRY_LINK(
......
...@@ -221,36 +221,10 @@ VLC_EXPORT (int, vlc_poll, (struct pollfd *fds, unsigned nfds, int timeout)); ...@@ -221,36 +221,10 @@ VLC_EXPORT (int, vlc_poll, (struct pollfd *fds, unsigned nfds, int timeout));
# endif # endif
# define NI_MAXNUMERICHOST 64 # define NI_MAXNUMERICHOST 64
# ifndef NI_NUMERICHOST
# define NI_NUMERICHOST 0x01
# define NI_NUMERICSERV 0x02
# define NI_NOFQDN 0x04
# define NI_NAMEREQD 0x08
# define NI_DGRAM 0x10
# endif
# ifndef HAVE_STRUCT_ADDRINFO
struct addrinfo
{
int ai_flags;
int ai_family;
int ai_socktype;
int ai_protocol;
size_t ai_addrlen;
struct sockaddr *ai_addr;
char *ai_canonname;
struct addrinfo *ai_next;
};
# define AI_PASSIVE 1
# define AI_CANONNAME 2
# define AI_NUMERICHOST 4
# endif /* if !HAVE_STRUCT_ADDRINFO */
#ifndef AI_NUMERICSERV #ifndef AI_NUMERICSERV
# define AI_NUMERICSERV 0 # define AI_NUMERICSERV 0
#endif #endif
VLC_EXPORT( const char *, vlc_gai_strerror, ( int ) );
VLC_EXPORT( int, vlc_getnameinfo, ( const struct sockaddr *, int, char *, int, int *, int ) ); VLC_EXPORT( int, vlc_getnameinfo, ( const struct sockaddr *, int, char *, int, int *, int ) );
VLC_EXPORT( int, vlc_getaddrinfo, ( vlc_object_t *, const char *, int, const struct addrinfo *, struct addrinfo ** ) ); VLC_EXPORT( int, vlc_getaddrinfo, ( vlc_object_t *, const char *, int, const struct addrinfo *, struct addrinfo ** ) );
VLC_EXPORT( void, vlc_freeaddrinfo, ( struct addrinfo * ) ); VLC_EXPORT( void, vlc_freeaddrinfo, ( struct addrinfo * ) );
......
...@@ -511,7 +511,6 @@ vlc_fourcc_IsYUV ...@@ -511,7 +511,6 @@ vlc_fourcc_IsYUV
vlc_fourcc_GetRGBFallback vlc_fourcc_GetRGBFallback
vlc_fourcc_GetYUVFallback vlc_fourcc_GetYUVFallback
vlc_fourcc_AreUVPlanesSwapped vlc_fourcc_AreUVPlanesSwapped
vlc_gai_strerror
vlc_gc_init vlc_gc_init
vlc_GetActionId vlc_GetActionId
vlc_getaddrinfo vlc_getaddrinfo
......
This diff is collapsed.
...@@ -141,7 +141,7 @@ int *net_Listen (vlc_object_t *p_this, const char *psz_host, ...@@ -141,7 +141,7 @@ int *net_Listen (vlc_object_t *p_this, const char *psz_host,
if (i_val) if (i_val)
{ {
msg_Err (p_this, "Cannot resolve %s port %d : %s", psz_host, i_port, msg_Err (p_this, "Cannot resolve %s port %d : %s", psz_host, i_port,
vlc_gai_strerror (i_val)); gai_strerror (i_val));
return NULL; return NULL;
} }
......
...@@ -142,7 +142,7 @@ int net_Connect( vlc_object_t *p_this, const char *psz_host, int i_port, ...@@ -142,7 +142,7 @@ int net_Connect( vlc_object_t *p_this, const char *psz_host, int i_port,
if( i_val ) if( i_val )
{ {
msg_Err( p_this, "cannot resolve %s port %d : %s", psz_realhost, msg_Err( p_this, "cannot resolve %s port %d : %s", psz_realhost,
i_realport, vlc_gai_strerror( i_val ) ); i_realport, gai_strerror( i_val ) );
return -1; return -1;
} }
......
...@@ -155,7 +155,7 @@ static int net_ListenSingle (vlc_object_t *obj, const char *host, int port, ...@@ -155,7 +155,7 @@ static int net_ListenSingle (vlc_object_t *obj, const char *host, int port,
if (val) if (val)
{ {
msg_Err (obj, "Cannot resolve %s port %d : %s", host, port, msg_Err (obj, "Cannot resolve %s port %d : %s", host, port,
vlc_gai_strerror (val)); gai_strerror (val));
return -1; return -1;
} }
...@@ -661,7 +661,7 @@ int net_ConnectDgram( vlc_object_t *p_this, const char *psz_host, int i_port, ...@@ -661,7 +661,7 @@ int net_ConnectDgram( vlc_object_t *p_this, const char *psz_host, int i_port,
if( i_val ) if( i_val )
{ {
msg_Err( p_this, "cannot resolve [%s]:%d : %s", psz_host, i_port, msg_Err( p_this, "cannot resolve [%s]:%d : %s", psz_host, i_port,
vlc_gai_strerror( i_val ) ); gai_strerror( i_val ) );
return -1; return -1;
} }
...@@ -764,7 +764,7 @@ int net_OpenDgram( vlc_object_t *obj, const char *psz_bind, int i_bind, ...@@ -764,7 +764,7 @@ int net_OpenDgram( vlc_object_t *obj, const char *psz_bind, int i_bind,
if (val) if (val)
{ {
msg_Err (obj, "cannot resolve %s port %d : %s", psz_bind, i_bind, msg_Err (obj, "cannot resolve %s port %d : %s", psz_bind, i_bind,
vlc_gai_strerror (val)); gai_strerror (val));
return -1; return -1;
} }
...@@ -773,7 +773,7 @@ int net_OpenDgram( vlc_object_t *obj, const char *psz_bind, int i_bind, ...@@ -773,7 +773,7 @@ int net_OpenDgram( vlc_object_t *obj, const char *psz_bind, int i_bind,
if (val) if (val)
{ {
msg_Err (obj, "cannot resolve %s port %d : %s", psz_bind, i_bind, msg_Err (obj, "cannot resolve %s port %d : %s", psz_bind, i_bind,
vlc_gai_strerror (val)); gai_strerror (val));
vlc_freeaddrinfo (rem); vlc_freeaddrinfo (rem);
return -1; return -1;
} }
......
...@@ -307,7 +307,7 @@ int SAP_Add (sap_handler_t *p_sap, session_descriptor_t *p_session) ...@@ -307,7 +307,7 @@ int SAP_Add (sap_handler_t *p_sap, session_descriptor_t *p_session)
if( i ) if( i )
{ {
msg_Err( p_sap, "%s", vlc_gai_strerror( i ) ); msg_Err( p_sap, "%s", gai_strerror( i ) );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment