Commit 10e0eec4 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

net: add vlc_getaddrinfo_i11e() stub

The function should provide interrupt DNS resolution, so a thread can
abort a DNS query (e.g. if network is down or really slow).

The stub is not interruptible. This makes no difference to the existing
uninterruptible (mis)behaviour.
parent dd8756a5
......@@ -231,7 +231,8 @@ VLC_API int getnameinfo ( const struct sockaddr *, socklen_t,
VLC_API int vlc_getnameinfo( const struct sockaddr *, int, char *, int, int *, int );
VLC_API int vlc_getaddrinfo (const char *, unsigned,
const struct addrinfo *, struct addrinfo **);
int vlc_getaddrinfo_i11e(const char *, unsigned, const struct addrinfo *,
struct addrinfo **);
#ifdef __OS2__
/* OS/2 does not support IPv6, yet. But declare these only for compilation */
......
......@@ -119,3 +119,10 @@ int vlc_getaddrinfo (const char *node, unsigned port,
return getaddrinfo (node, servname, hints, res);
}
#warning vlc_getaddr_info_i11e() not implemented!
int vlc_getaddrinfo_i11e(const char *node, unsigned port,
const struct addrinfo *hints, struct addrinfo **res)
{
return vlc_getaddrinfo(node, port, hints, res);
}
......@@ -127,7 +127,7 @@ int net_Connect( vlc_object_t *p_this, const char *psz_host, int i_port,
.ai_flags = AI_NUMERICSERV | AI_IDN,
}, *res;
int val = vlc_getaddrinfo (psz_realhost, i_realport, &hints, &res);
int val = vlc_getaddrinfo_i11e(psz_realhost, i_realport, &hints, &res);
if (val)
{
msg_Err (p_this, "cannot resolve %s port %d : %s", psz_realhost,
......@@ -435,7 +435,7 @@ static int SocksHandshakeTCP( vlc_object_t *p_obj,
};
struct addrinfo *res;
if (vlc_getaddrinfo (psz_host, 0, &hints, &res))
if (vlc_getaddrinfo_i11e(psz_host, 0, &hints, &res))
return VLC_EGENERIC;
buffer[0] = i_socks_version;
......
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