Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
b884f957
Commit
b884f957
authored
Mar 03, 2007
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve getaddrinfo() replacement errors
parent
183fc7bd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
30 deletions
+28
-30
src/network/getaddrinfo.c
src/network/getaddrinfo.c
+28
-30
No files found.
src/network/getaddrinfo.c
View file @
b884f957
...
...
@@ -103,35 +103,6 @@ const char *vlc_gai_strerror (int errnum)
#endif
#ifndef WIN32
#if !(defined (HAVE_GETNAMEINFO) && defined (HAVE_GETADDRINFO))
/*
* Converts the current herrno error value into an EAI_* error code.
* That error code is normally returned by getnameinfo() or getaddrinfo().
*/
static
int
gai_error_from_herrno
(
void
)
{
switch
(
h_errno
)
{
case
HOST_NOT_FOUND
:
return
EAI_NONAME
;
case
NO_ADDRESS
:
# if (NO_ADDRESS != NO_DATA)
case
NO_DATA
:
# endif
return
EAI_NODATA
;
case
NO_RECOVERY
:
return
EAI_FAIL
;
case
TRY_AGAIN
:
return
EAI_AGAIN
;
}
return
EAI_SYSTEM
;
}
#endif
/* if !(HAVE_GETNAMEINFO && HAVE_GETADDRINFO) */
#ifndef HAVE_GETNAMEINFO
/*
* getnameinfo() non-thread-safe IPv4-only implementation,
...
...
@@ -191,6 +162,33 @@ getnameinfo (const struct sockaddr *sa, socklen_t salen,
#endif
/* if !HAVE_GETNAMEINFO */
#ifndef HAVE_GETADDRINFO
/*
* Converts the current herrno error value into an EAI_* error code.
* That error code is normally returned by getnameinfo() or getaddrinfo().
*/
static
int
gai_error_from_herrno
(
void
)
{
switch
(
h_errno
)
{
case
HOST_NOT_FOUND
:
return
EAI_NONAME
;
case
NO_ADDRESS
:
# if (NO_ADDRESS != NO_DATA)
case
NO_DATA
:
# endif
return
EAI_NODATA
;
case
NO_RECOVERY
:
return
EAI_FAIL
;
case
TRY_AGAIN
:
return
EAI_AGAIN
;
}
return
EAI_SYSTEM
;
}
/*
* This functions must be used to free the memory allocated by getaddrinfo().
*/
...
...
@@ -368,7 +366,7 @@ getaddrinfo (const char *node, const char *service,
entry
=
gethostbyname
(
node
);
if
(
entry
==
NULL
)
return
EAI_NONAME
;
return
gai_error_from_herrno
()
;
if
((
entry
->
h_length
!=
4
)
||
(
entry
->
h_addrtype
!=
AF_INET
))
return
EAI_FAMILY
;
...
...
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