Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-1.1
Commits
e90520eb
Commit
e90520eb
authored
Mar 03, 2007
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not chain multiple getaddrinfo implementation.
This is bound to crash.
parent
bf9fed9b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
43 deletions
+31
-43
src/network/getaddrinfo.c
src/network/getaddrinfo.c
+31
-43
No files found.
src/network/getaddrinfo.c
View file @
e90520eb
...
@@ -566,12 +566,11 @@ int vlc_getnameinfo( const struct sockaddr *sa, int salen,
...
@@ -566,12 +566,11 @@ int vlc_getnameinfo( const struct sockaddr *sa, int salen,
psz_serv
=
NULL
;
psz_serv
=
NULL
;
i_servlen
=
0
;
i_servlen
=
0
;
}
}
#if defined( WIN32 ) && !defined( UNDER_CE )
i_val
=
ws2_getnameinfo
(
sa
,
salen
,
host
,
hostlen
,
psz_serv
,
#if defined (HAVE_GETNAMEINFO)
i_servlen
,
flags
);
#endif
#if defined( HAVE_GETNAMEINFO ) || defined( UNDER_CE )
i_val
=
getnameinfo
(
sa
,
salen
,
host
,
hostlen
,
psz_serv
,
i_servlen
,
flags
);
i_val
=
getnameinfo
(
sa
,
salen
,
host
,
hostlen
,
psz_serv
,
i_servlen
,
flags
);
#elif defined (WIN32)
i_val
=
ws2_getnameinfo
(
sa
,
salen
,
host
,
hostlen
,
psz_serv
,
i_servlen
,
flags
);
#else
#else
i_val
=
__getnameinfo
(
sa
,
salen
,
host
,
hostlen
,
psz_serv
,
i_servlen
,
flags
);
i_val
=
__getnameinfo
(
sa
,
salen
,
host
,
hostlen
,
psz_serv
,
i_servlen
,
flags
);
#endif
#endif
...
@@ -655,7 +654,7 @@ int vlc_getaddrinfo( vlc_object_t *p_this, const char *node,
...
@@ -655,7 +654,7 @@ int vlc_getaddrinfo( vlc_object_t *p_this, const char *node,
}
}
}
}
#if
defined( WIN32 ) && !defined( UNDER_CE )
#if
def WIN32
/*
/*
* Winsock tries to resolve numerical IPv4 addresses as AAAA
* Winsock tries to resolve numerical IPv4 addresses as AAAA
* and IPv6 addresses as A... There comes the work around.
* and IPv6 addresses as A... There comes the work around.
...
@@ -669,61 +668,50 @@ int vlc_getaddrinfo( vlc_object_t *p_this, const char *node,
...
@@ -669,61 +668,50 @@ int vlc_getaddrinfo( vlc_object_t *p_this, const char *node,
hints
.
ai_flags
&=
~
AI_NUMERICHOST
;
hints
.
ai_flags
&=
~
AI_NUMERICHOST
;
}
}
return
ws2_getaddrinfo
(
psz_node
,
psz_service
,
&
hints
,
res
);
#endif
#endif
#if defined
( HAVE_GETADDRINFO ) || defined( UNDER_CE
)
#if defined
(HAVE_GETADDRINFO
)
# ifdef AI_IDN
# ifdef AI_IDN
/* Run-time I18n Domain Names support */
/* Run-time I18n Domain Names support */
{
static
vlc_bool_t
b_idn
=
VLC_TRUE
;
/* beware of thread-safety */
static
vlc_bool_t
i_idn
=
VLC_TRUE
;
/* beware of thread-safety */
if
(
i_idn
)
{
int
i_ret
;
hints
.
ai_flags
|=
AI_IDN
;
if
(
b_idn
)
i_ret
=
getaddrinfo
(
psz_node
,
psz_service
,
&
hints
,
res
);
{
hints
.
ai_flags
|=
AI_IDN
;
if
(
i_ret
!=
EAI_BADFLAGS
)
int
ret
=
getaddrinfo
(
psz_node
,
psz_service
,
&
hints
,
res
);
return
i_ret
;
/* libidn not available: disable and retry without it */
if
(
ret
!=
EAI_BADFLAGS
)
return
ret
;
/* NOTE: Using i_idn here would not be thread-safe */
/* IDN not available: disable and retry without it */
hints
.
ai_flags
&=
~
AI_IDN
;
hints
.
ai_flags
&=
~
AI_IDN
;
i_idn
=
VLC_FALSE
;
b_idn
=
VLC_FALSE
;
msg_Dbg
(
p_this
,
"International Domain Names not supported - "
\
msg_Info
(
p_this
,
"International Domain Names not supported"
);
"disabled"
);
}
}
}
# endif
# endif
return
getaddrinfo
(
psz_node
,
psz_service
,
&
hints
,
res
);
return
getaddrinfo
(
psz_node
,
psz_service
,
&
hints
,
res
);
#elif defined (WIN32)
return
ws2_getaddrinfo
(
psz_node
,
psz_service
,
&
hints
,
res
);
#else
#else
{
int
ret
;
int
i_ret
;
vlc_value_t
lock
;
vlc_value_t
lock
;
var_Create
(
p_this
->
p_libvlc
,
"getaddrinfo_mutex"
,
VLC_VAR_MUTEX
);
var_Create
(
p_this
->
p_libvlc
,
"getaddrinfo_mutex"
,
VLC_VAR_MUTEX
);
var_Get
(
p_this
->
p_libvlc
,
"getaddrinfo_mutex"
,
&
lock
);
var_Get
(
p_this
->
p_libvlc
,
"getaddrinfo_mutex"
,
&
lock
);
vlc_mutex_lock
(
lock
.
p_address
);
vlc_mutex_lock
(
lock
.
p_address
);
i_ret
=
__getaddrinfo
(
psz_node
,
psz_service
,
&
hints
,
res
);
int
ret
=
__getaddrinfo
(
psz_node
,
psz_service
,
&
hints
,
res
);
vlc_mutex_unlock
(
lock
.
p_address
);
vlc_mutex_unlock
(
lock
.
p_address
);
return
i_ret
;
return
ret
;
}
#endif
#endif
}
}
void
vlc_freeaddrinfo
(
struct
addrinfo
*
infos
)
void
vlc_freeaddrinfo
(
struct
addrinfo
*
infos
)
{
{
#if defined( WIN32 ) && !defined( UNDER_CE )
#if defined (HAVE_GETADDRINFO)
ws2_freeaddrinfo
(
infos
);
freeaddrinfo
(
infos
);
#endif
#elif defined (WIN32)
#if defined( HAVE_GETADDRINFO ) || defined( UNDER_CE )
ws2_freeaddrinfo
(
infos
);
freeaddrinfo
(
infos
);
#else
#else
__freeaddrinfo
(
infos
);
__freeaddrinfo
(
infos
);
#endif
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment