Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
c2b02955
Commit
c2b02955
authored
Sep 19, 2007
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify net_Listen (no real use for family and type parameters)
parent
e70a1a42
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
11 deletions
+7
-11
include/vlc_network.h
include/vlc_network.h
+2
-7
src/network/io.c
src/network/io.c
+5
-4
No files found.
include/vlc_network.h
View file @
c2b02955
...
@@ -76,16 +76,11 @@ int net_SetupSocket (int fd);
...
@@ -76,16 +76,11 @@ int net_SetupSocket (int fd);
#define net_Connect(a, b, c, d, e) __net_Connect(VLC_OBJECT(a), b, c, d, e)
#define net_Connect(a, b, c, d, e) __net_Connect(VLC_OBJECT(a), b, c, d, e)
VLC_EXPORT
(
int
,
__net_Connect
,
(
vlc_object_t
*
p_this
,
const
char
*
psz_host
,
int
i_port
,
int
socktype
,
int
protocol
)
);
VLC_EXPORT
(
int
,
__net_Connect
,
(
vlc_object_t
*
p_this
,
const
char
*
psz_host
,
int
i_port
,
int
socktype
,
int
protocol
)
);
VLC_EXPORT
(
int
*
,
net_Listen
,
(
vlc_object_t
*
p_this
,
const
char
*
psz_host
,
int
i_port
,
int
family
,
int
socktype
,
int
protocol
)
);
VLC_EXPORT
(
int
*
,
net_Listen
,
(
vlc_object_t
*
p_this
,
const
char
*
psz_host
,
int
i_port
,
int
protocol
)
);
#define net_ListenTCP(a, b, c)
__net_ListenTCP(VLC_OBJECT(a), b, c
)
#define net_ListenTCP(a, b, c)
net_Listen(VLC_OBJECT(a), b, c, IPPROTO_TCP
)
#define net_ConnectTCP(a, b, c) __net_ConnectTCP(VLC_OBJECT(a), b, c)
#define net_ConnectTCP(a, b, c) __net_ConnectTCP(VLC_OBJECT(a), b, c)
static
inline
int
*
__net_ListenTCP
(
vlc_object_t
*
obj
,
const
char
*
host
,
int
port
)
{
return
net_Listen
(
obj
,
host
,
port
,
AF_UNSPEC
,
SOCK_STREAM
,
IPPROTO_TCP
);
}
static
inline
int
__net_ConnectTCP
(
vlc_object_t
*
obj
,
const
char
*
host
,
int
port
)
static
inline
int
__net_ConnectTCP
(
vlc_object_t
*
obj
,
const
char
*
host
,
int
port
)
{
{
return
__net_Connect
(
obj
,
host
,
port
,
SOCK_STREAM
,
IPPROTO_TCP
);
return
__net_Connect
(
obj
,
host
,
port
,
SOCK_STREAM
,
IPPROTO_TCP
);
...
...
src/network/io.c
View file @
c2b02955
...
@@ -119,13 +119,14 @@ int net_Socket (vlc_object_t *p_this, int family, int socktype,
...
@@ -119,13 +119,14 @@ int net_Socket (vlc_object_t *p_this, int family, int socktype,
int
*
net_Listen
(
vlc_object_t
*
p_this
,
const
char
*
psz_host
,
int
*
net_Listen
(
vlc_object_t
*
p_this
,
const
char
*
psz_host
,
int
i_port
,
int
family
,
int
socktype
,
int
protocol
)
int
i_port
,
int
protocol
)
{
{
struct
addrinfo
hints
,
*
res
;
struct
addrinfo
hints
,
*
res
;
memset
(
&
hints
,
0
,
sizeof
(
hints
));
memset
(
&
hints
,
0
,
sizeof
(
hints
));
hints
.
ai_family
=
family
;
/* Since we use port numbers rather than service names, the socket type
hints
.
ai_socktype
=
socktype
;
* does not really matter. */
hints
.
ai_socktype
=
SOCK_STREAM
;
hints
.
ai_flags
=
AI_PASSIVE
;
hints
.
ai_flags
=
AI_PASSIVE
;
msg_Dbg
(
p_this
,
"net: listening to %s port %d"
,
psz_host
,
i_port
);
msg_Dbg
(
p_this
,
"net: listening to %s port %d"
,
psz_host
,
i_port
);
...
@@ -144,7 +145,7 @@ int *net_Listen (vlc_object_t *p_this, const char *psz_host,
...
@@ -144,7 +145,7 @@ int *net_Listen (vlc_object_t *p_this, const char *psz_host,
for
(
struct
addrinfo
*
ptr
=
res
;
ptr
!=
NULL
;
ptr
=
ptr
->
ai_next
)
for
(
struct
addrinfo
*
ptr
=
res
;
ptr
!=
NULL
;
ptr
=
ptr
->
ai_next
)
{
{
int
fd
=
net_Socket
(
p_this
,
ptr
->
ai_family
,
ptr
->
ai_socktype
,
int
fd
=
net_Socket
(
p_this
,
ptr
->
ai_family
,
ptr
->
ai_socktype
,
protocol
?:
ptr
->
ai_protocol
);
protocol
);
if
(
fd
==
-
1
)
if
(
fd
==
-
1
)
{
{
msg_Dbg
(
p_this
,
"socket error: %m"
);
msg_Dbg
(
p_this
,
"socket error: %m"
);
...
...
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