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
93c16a0b
Commit
93c16a0b
authored
Feb 26, 2007
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify shutdown() portability
parent
42388a77
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
12 additions
and
32 deletions
+12
-32
include/vlc_network.h
include/vlc_network.h
+4
-22
modules/access/ftp.c
modules/access/ftp.c
+2
-4
modules/access/udp.c
modules/access/udp.c
+1
-1
modules/access_output/udp.c
modules/access_output/udp.c
+1
-1
modules/misc/notify/growl.c
modules/misc/notify/growl.c
+1
-1
modules/services_discovery/sap.c
modules/services_discovery/sap.c
+1
-1
src/stream_output/sap.c
src/stream_output/sap.c
+2
-2
No files found.
include/vlc_network.h
View file @
93c16a0b
...
@@ -176,29 +176,11 @@ struct pollfd
...
@@ -176,29 +176,11 @@ struct pollfd
int
poll
(
struct
pollfd
*
fds
,
unsigned
nfds
,
int
timeout
);
int
poll
(
struct
pollfd
*
fds
,
unsigned
nfds
,
int
timeout
);
#endif
#endif
/*****************************************************************************
* net_StopRecv/Send
*****************************************************************************
* Wrappers for shutdown()
*****************************************************************************/
#if defined (SHUT_WR)
/* the standard way */
# define net_StopSend( fd ) (void)shutdown( fd, SHUT_WR )
# define net_StopRecv( fd ) (void)shutdown( fd, SHUT_RD )
#elif defined (SD_SEND)
/* the Microsoft seemingly-purposedly-different-for-the-sake-of-it way */
# define net_StopSend( fd ) (void)shutdown( fd, SD_SEND )
# define net_StopRecv( fd ) (void)shutdown( fd, SD_RECEIVE )
#else
# ifndef SYS_BEOS
/* R5 just doesn't have a working shutdown() */
# warning FIXME: implement shutdown on your platform!
# endif
# define net_StopSend( fd ) (void)0
# define net_StopRecv( fd ) (void)0
#endif
#ifdef WIN32
#ifdef WIN32
/* Microsoft: same semantic, same value, different name... go figure */
# define SHUT_RD SD_RECEIVE
# define SHUT_WR SD_SEND
# define SHUT_BOTH
# define net_Close( fd ) closesocket ((SOCKET)fd)
# define net_Close( fd ) closesocket ((SOCKET)fd)
#else
#else
# define net_Close( fd ) close (fd)
# define net_Close( fd ) close (fd)
...
...
modules/access/ftp.c
View file @
93c16a0b
...
@@ -758,10 +758,8 @@ static int ftp_StartStream( vlc_object_t *p_access, access_sys_t *p_sys,
...
@@ -758,10 +758,8 @@ static int ftp_StartStream( vlc_object_t *p_access, access_sys_t *p_sys,
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
}
if
(
p_access
->
i_object_type
==
VLC_OBJECT_ACCESS
)
shutdown
(
p_sys
->
fd_data
,
net_StopSend
(
p_sys
->
fd_data
);
(
p_access
->
i_object_type
==
VLC_OBJECT_ACCESS
)
);
else
net_StopRecv
(
p_sys
->
fd_data
);
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
}
}
...
...
modules/access/udp.c
View file @
93c16a0b
...
@@ -258,7 +258,7 @@ static int Open( vlc_object_t *p_this )
...
@@ -258,7 +258,7 @@ static int Open( vlc_object_t *p_this )
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
}
net_StopSend
(
p_sys
->
fd
);
shutdown
(
p_sys
->
fd
,
SHUT_WR
);
#ifdef UDPLITE_RECV_CSCOV
#ifdef UDPLITE_RECV_CSCOV
if
(
proto
==
IPPROTO_UDPLITE
)
if
(
proto
==
IPPROTO_UDPLITE
)
...
...
modules/access_output/udp.c
View file @
93c16a0b
...
@@ -323,7 +323,7 @@ static int Open( vlc_object_t *p_this )
...
@@ -323,7 +323,7 @@ static int Open( vlc_object_t *p_this )
}
}
}
}
p_sys
->
p_thread
->
i_handle
=
i_handle
;
p_sys
->
p_thread
->
i_handle
=
i_handle
;
net_StopRecv
(
i_handle
);
shutdown
(
i_handle
,
SHUT_RD
);
#ifdef UDPLITE_SEND_CSCOV
#ifdef UDPLITE_SEND_CSCOV
if
(
proto
==
IPPROTO_UDPLITE
)
if
(
proto
==
IPPROTO_UDPLITE
)
...
...
modules/misc/notify/growl.c
View file @
93c16a0b
...
@@ -278,7 +278,7 @@ static int CheckAndSend( vlc_object_t *p_this, uint8_t* p_data, int i_offset )
...
@@ -278,7 +278,7 @@ static int CheckAndSend( vlc_object_t *p_this, uint8_t* p_data, int i_offset )
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
}
net_StopRecv
(
i_handle
);
shutdown
(
i_handle
,
SHUT_RD
);
if
(
send
(
i_handle
,
p_data
,
i_offset
,
0
)
if
(
send
(
i_handle
,
p_data
,
i_offset
,
0
)
==
-
1
)
==
-
1
)
{
{
...
...
modules/services_discovery/sap.c
View file @
93c16a0b
...
@@ -1361,7 +1361,7 @@ static int InitSocket( services_discovery_t *p_sd, const char *psz_address,
...
@@ -1361,7 +1361,7 @@ static int InitSocket( services_discovery_t *p_sd, const char *psz_address,
if
(
i_fd
==
-
1
)
if
(
i_fd
==
-
1
)
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
net_StopSend
(
i_fd
);
shutdown
(
i_fd
,
SHUT_WR
);
INSERT_ELEM
(
p_sd
->
p_sys
->
pi_fd
,
p_sd
->
p_sys
->
i_fd
,
INSERT_ELEM
(
p_sd
->
p_sys
->
pi_fd
,
p_sd
->
p_sys
->
i_fd
,
p_sd
->
p_sys
->
i_fd
,
i_fd
);
p_sd
->
p_sys
->
i_fd
,
i_fd
);
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
...
...
src/stream_output/sap.c
View file @
93c16a0b
...
@@ -380,7 +380,7 @@ static int announce_SAPAnnounceAdd( sap_handler_t *p_sap,
...
@@ -380,7 +380,7 @@ static int announce_SAPAnnounceAdd( sap_handler_t *p_sap,
p_address
->
i_wfd
=
net_ConnectUDP
(
VLC_OBJECT
(
p_sap
),
psz_addr
,
SAP_PORT
,
255
);
p_address
->
i_wfd
=
net_ConnectUDP
(
VLC_OBJECT
(
p_sap
),
psz_addr
,
SAP_PORT
,
255
);
if
(
p_address
->
i_wfd
!=
-
1
)
if
(
p_address
->
i_wfd
!=
-
1
)
{
{
net_StopRecv
(
p_address
->
i_wfd
);
shutdown
(
p_address
->
i_wfd
,
SHUT_RD
);
p_address
->
origlen
=
sizeof
(
p_address
->
orig
);
p_address
->
origlen
=
sizeof
(
p_address
->
orig
);
getsockname
(
p_address
->
i_wfd
,
(
struct
sockaddr
*
)
&
p_address
->
orig
,
getsockname
(
p_address
->
i_wfd
,
(
struct
sockaddr
*
)
&
p_address
->
orig
,
&
p_address
->
origlen
);
&
p_address
->
origlen
);
...
@@ -390,7 +390,7 @@ static int announce_SAPAnnounceAdd( sap_handler_t *p_sap,
...
@@ -390,7 +390,7 @@ static int announce_SAPAnnounceAdd( sap_handler_t *p_sap,
{
{
p_address
->
i_rfd
=
net_ListenUDP1
(
(
vlc_object_t
*
)
p_sap
,
psz_addr
,
SAP_PORT
);
p_address
->
i_rfd
=
net_ListenUDP1
(
(
vlc_object_t
*
)
p_sap
,
psz_addr
,
SAP_PORT
);
if
(
p_address
->
i_rfd
!=
-
1
)
if
(
p_address
->
i_rfd
!=
-
1
)
net_StopSend
(
p_address
->
i_rfd
);
shutdown
(
p_address
->
i_rfd
,
SHUT_WR
);
p_address
->
i_buff
=
0
;
p_address
->
i_buff
=
0
;
p_address
->
b_enabled
=
VLC_TRUE
;
p_address
->
b_enabled
=
VLC_TRUE
;
p_address
->
b_ready
=
VLC_FALSE
;
p_address
->
b_ready
=
VLC_FALSE
;
...
...
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