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
8600577e
Commit
8600577e
authored
Jul 20, 2004
by
Gildas Bazin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* src/misc/httpd.c: fixed non-initialized variable that prevented getaddrinfo() from working.
parent
c163444a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
12 deletions
+8
-12
src/misc/httpd.c
src/misc/httpd.c
+8
-12
No files found.
src/misc/httpd.c
View file @
8600577e
...
...
@@ -902,27 +902,23 @@ httpd_host_t *httpd_HostNew( vlc_object_t *p_this, char *psz_host, int i_port )
char
psz_port
[
6
];
struct
addrinfo
hints
;
#if 0
memset
(
&
hints
,
0
,
sizeof
(
hints
)
);
/* Check if we have force ipv4 or ipv6 */
#if 0
/* Check if ipv4 or ipv6 were forced */
var_Create( p_this, "ipv4", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
var_Get( p_this, "ipv4", &val );
if( val.b_bool )
hints.ai_family = PF_INET;
if( val.b_bool ) hints.ai_family = PF_INET;
#else
/*
* For now, keep IPv4 by default. That said, it should be safe to use
* IPv6 by default *on the server side*, as, apart from NetBSD, most
* systems accept IPv4 clients on IPv6 listening sockets.
*
*
*/
hints
.
ai_family
=
PF_INET
;
var_Create
(
p_this
,
"ipv6"
,
VLC_VAR_BOOL
|
VLC_VAR_DOINHERIT
);
var_Get
(
p_this
,
"ipv6"
,
&
val
);
if
(
val
.
b_bool
)
hints
.
ai_family
=
0
;
// try IPv6, then IPv4
if
(
val
.
b_bool
)
hints
.
ai_family
=
0
;
// try IPv6, then IPv4
#endif
hints
.
ai_socktype
=
SOCK_STREAM
;
...
...
@@ -940,6 +936,7 @@ httpd_host_t *httpd_HostNew( vlc_object_t *p_this, char *psz_host, int i_port )
return
NULL
;
}
}
#else
struct
sockaddr_in
sock
;
struct
httpd_addrinfo
info
;
...
...
@@ -997,7 +994,7 @@ httpd_host_t *httpd_HostNew( vlc_object_t *p_this, char *psz_host, int i_port )
/* verify if it already exist */
for
(
i
=
0
;
i
<
httpd
->
i_host
;
i
++
)
{
if
(
GetAddrPort
(
&
httpd
->
host
[
i
]
->
sock
)
!=
i_port
)
if
(
GetAddrPort
(
&
httpd
->
host
[
i
]
->
sock
)
!=
i_port
)
continue
;
#ifdef AF_INET6
...
...
@@ -1101,8 +1098,7 @@ httpd_host_t *httpd_HostNew( vlc_object_t *p_this, char *psz_host, int i_port )
if
(
listen
(
fd
,
LISTEN_BACKLOG
)
<
0
)
{
msg_Err
(
p_this
,
"cannot listen socket"
);
close
(
fd
);
fd
=
-
1
;
goto
socket_error
;
}
continue
;
...
...
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