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

Better thread-safety in previous commit

parent a8497048
...@@ -662,13 +662,13 @@ int vlc_getaddrinfo( vlc_object_t *p_this, const char *node, ...@@ -662,13 +662,13 @@ int vlc_getaddrinfo( vlc_object_t *p_this, const char *node,
# ifdef AI_IDN # ifdef AI_IDN
/* Run-time I18n Domain Names support */ /* Run-time I18n Domain Names support */
{ {
static int i_idn = AI_IDN; /* beware of thread-safety */ static vlc_bool_t i_idn = VLC_TRUE; /* beware of thread-safety */
if( i_idn ) if( i_idn )
{ {
int i_ret; int i_ret;
hints.ai_flags |= i_idn; hints.ai_flags |= AI_IDN;
i_ret = getaddrinfo( psz_node, psz_service, &hints, res ); i_ret = getaddrinfo( psz_node, psz_service, &hints, res );
if( i_ret != EAI_BADFLAGS ) if( i_ret != EAI_BADFLAGS )
...@@ -678,7 +678,7 @@ int vlc_getaddrinfo( vlc_object_t *p_this, const char *node, ...@@ -678,7 +678,7 @@ int vlc_getaddrinfo( vlc_object_t *p_this, const char *node,
/* NOTE: Using i_idn here would not be thread-safe */ /* NOTE: Using i_idn here would not be thread-safe */
hints.ai_flags &= ~AI_IDN; hints.ai_flags &= ~AI_IDN;
i_idn = 0; i_idn = VLC_FALSE;
msg_Dbg( p_this, "I18n Domain Names not supported - disabled" ); msg_Dbg( p_this, "I18n Domain Names not supported - disabled" );
} }
} }
......
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