Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
a15150a4
Commit
a15150a4
authored
Jul 29, 2005
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't require a vlc_object_t in net_Get(Sock|Peer)Address
(will be needed by a later commit)
parent
31e2f2b1
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
30 deletions
+17
-30
include/network.h
include/network.h
+14
-26
modules/access/ftp.c
modules/access/ftp.c
+1
-2
modules/access/mms/mmstu.c
modules/access/mms/mmstu.c
+2
-2
No files found.
include/network.h
View file @
a15150a4
...
@@ -32,7 +32,6 @@
...
@@ -32,7 +32,6 @@
# include <winsock2.h>
# include <winsock2.h>
# include <ws2tcpip.h>
# include <ws2tcpip.h>
#else
#else
# include <errno.h>
# include <netdb.h>
# include <netdb.h>
#if HAVE_SYS_SOCKET_H
#if HAVE_SYS_SOCKET_H
# include <sys/socket.h>
# include <sys/socket.h>
...
@@ -506,37 +505,26 @@ static inline vlc_bool_t net_AddressIsMulticast( vlc_object_t *p_object, char *p
...
@@ -506,37 +505,26 @@ static inline vlc_bool_t net_AddressIsMulticast( vlc_object_t *p_object, char *p
return
b_multicast
;
return
b_multicast
;
}
}
#define net_GetSockAddress(a,b,c,d) __net_GetAddress(VLC_OBJECT(a),VLC_FALSE,b,c,d)
static
inline
int
net_GetSockAddress
(
int
fd
,
char
*
address
,
int
*
port
)
#define net_GetPeerAddress(a,b,c,d) __net_GetAddress(VLC_OBJECT(a),VLC_TRUE,b,c,d)
static
inline
int
__net_GetAddress
(
vlc_object_t
*
p_this
,
vlc_bool_t
peer
,
int
fd
,
char
*
address
,
int
*
port
)
{
{
struct
sockaddr_storage
addr
;
struct
sockaddr_storage
addr
;
socklen_t
addrlen
=
sizeof
(
addr
);
socklen_t
addrlen
=
sizeof
(
addr
);
int
val
;
val
=
peer
?
getpeername
(
fd
,
(
struct
sockaddr
*
)
&
addr
,
&
addrlen
)
return
getpeername
(
fd
,
(
struct
sockaddr
*
)
&
addr
,
&
addrlen
)
:
getsockname
(
fd
,
(
struct
sockaddr
*
)
&
addr
,
&
addrlen
);
||
vlc_getnameinfo
(
(
struct
sockaddr
*
)
&
addr
,
addrlen
,
address
,
NI_MAXNUMERICHOST
,
port
,
NI_NUMERICHOST
)
?
VLC_EGENERIC
:
0
;
}
if
(
val
)
static
inline
int
net_GetPeerAddress
(
int
fd
,
char
*
address
,
int
*
port
)
{
{
#if defined(WIN32) || defined (UNDER_CE)
struct
sockaddr_storage
addr
;
msg_Err
(
p_this
,
"socket address error : %d"
,
WSAGetLastError
(
)
);
socklen_t
addrlen
=
sizeof
(
addr
);
#else
msg_Err
(
p_this
,
"socket address error : %s"
,
strerror
(
errno
)
);
#endif
return
val
;
}
val
=
vlc_getnameinfo
(
(
struct
sockaddr
*
)
&
addr
,
addrlen
,
return
getpeername
(
fd
,
(
struct
sockaddr
*
)
&
addr
,
&
addrlen
)
address
,
NI_MAXNUMERICHOST
,
port
,
NI_NUMERICHOST
);
||
vlc_getnameinfo
(
(
struct
sockaddr
*
)
&
addr
,
addrlen
,
address
,
if
(
val
)
NI_MAXNUMERICHOST
,
port
,
NI_NUMERICHOST
)
{
?
VLC_EGENERIC
:
0
;
msg_Err
(
p_this
,
"socket address error : %s"
,
vlc_gai_strerror
(
val
)
);
}
return
0
;
}
}
#endif
#endif
modules/access/ftp.c
View file @
a15150a4
...
@@ -250,8 +250,7 @@ static int Open( vlc_object_t *p_this )
...
@@ -250,8 +250,7 @@ static int Open( vlc_object_t *p_this )
if
(
ftp_ReadCommand
(
p_access
,
&
i_answer
,
NULL
)
==
2
)
if
(
ftp_ReadCommand
(
p_access
,
&
i_answer
,
NULL
)
==
2
)
{
{
if
(
net_GetPeerAddress
(
p_access
,
p_sys
->
fd_cmd
,
p_sys
->
sz_epsv_ip
,
if
(
net_GetPeerAddress
(
p_sys
->
fd_cmd
,
p_sys
->
sz_epsv_ip
,
NULL
)
)
NULL
)
)
goto
exit_error
;
goto
exit_error
;
}
}
else
else
...
...
modules/access/mms/mmstu.c
View file @
a15150a4
...
@@ -490,8 +490,8 @@ static int MMSOpen( access_t *p_access, vlc_url_t *p_url, int i_proto )
...
@@ -490,8 +490,8 @@ static int MMSOpen( access_t *p_access, vlc_url_t *p_url, int i_proto )
/* *** Bind port if UDP protocol is selected *** */
/* *** Bind port if UDP protocol is selected *** */
if
(
b_udp
)
if
(
b_udp
)
{
{
if
(
net_GetSockAddress
(
p_
access
,
p_sys
->
i_handle_tcp
,
if
(
net_GetSockAddress
(
p_
sys
->
i_handle_tcp
,
p_sys
->
sz_bind_addr
,
p_sys
->
sz_bind_addr
,
NULL
)
)
NULL
)
)
{
{
net_Close
(
p_sys
->
i_handle_tcp
);
net_Close
(
p_sys
->
i_handle_tcp
);
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
...
...
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