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
c0cdab15
Commit
c0cdab15
authored
May 09, 2015
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove no longer used net_Read() argument
parent
9b629ed2
Changes
15
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
27 additions
and
44 deletions
+27
-44
include/vlc_network.h
include/vlc_network.h
+2
-2
modules/access/eyetv.m
modules/access/eyetv.m
+1
-2
modules/access/file.c
modules/access/file.c
+1
-1
modules/access/ftp.c
modules/access/ftp.c
+1
-1
modules/access/http.c
modules/access/http.c
+1
-1
modules/access/mms/mmsh.c
modules/access/mms/mmsh.c
+3
-3
modules/access/rtsp/access.c
modules/access/rtsp/access.c
+1
-1
modules/access/tcp.c
modules/access/tcp.c
+1
-2
modules/access/udp.c
modules/access/udp.c
+1
-1
modules/control/oldrc.c
modules/control/oldrc.c
+1
-1
modules/demux/adaptative/http/Sockets.cpp
modules/demux/adaptative/http/Sockets.cpp
+1
-1
modules/stream_filter/decomp.c
modules/stream_filter/decomp.c
+2
-2
modules/video_filter/remoteosd.c
modules/video_filter/remoteosd.c
+1
-3
src/network/io.c
src/network/io.c
+5
-18
src/network/tcp.c
src/network/tcp.c
+5
-5
No files found.
include/vlc_network.h
View file @
c0cdab15
...
...
@@ -143,8 +143,8 @@ struct virtual_socket_t
int
(
*
pf_send
)
(
void
*
,
const
void
*
,
size_t
);
};
VLC_API
ssize_t
net_Read
(
vlc_object_t
*
p_this
,
int
fd
,
const
v_socket_t
*
,
void
*
p_data
,
size_t
i_data
,
bool
b_retry
);
#define net_Read(a,b,c,d,e
,f) net_Read(VLC_OBJECT(a),b,c,d,e,f
)
VLC_API
ssize_t
net_Read
(
vlc_object_t
*
p_this
,
int
fd
,
void
*
p_data
,
size_t
i_data
,
bool
b_retry
);
#define net_Read(a,b,c,d,e
) net_Read(VLC_OBJECT(a),b,c,d,e
)
VLC_API
ssize_t
net_Write
(
vlc_object_t
*
p_this
,
int
fd
,
const
v_socket_t
*
,
const
void
*
p_data
,
size_t
i_data
);
#define net_Write(a,b,c,d,e) net_Write(VLC_OBJECT(a),b,c,d,e)
VLC_API
char
*
net_Gets
(
vlc_object_t
*
p_this
,
int
fd
);
...
...
modules/access/eyetv.m
View file @
c0cdab15
...
...
@@ -260,8 +260,7 @@ static block_t *BlockRead(access_t *p_access)
/* Read data */
p_block
=
block_Alloc
(
MTU
);
len
=
net_Read
(
p_access
,
p_sys
->
eyetvSock
,
NULL
,
p_block
->
p_buffer
,
MTU
,
false
);
len
=
net_Read
(
p_access
,
p_sys
->
eyetvSock
,
p_block
->
p_buffer
,
MTU
,
false
);
if
(
len
<
0
)
{
block_Release
(
p_block
);
...
...
modules/access/file.c
View file @
c0cdab15
...
...
@@ -342,7 +342,7 @@ static ssize_t StreamRead (access_t *p_access, uint8_t *p_buffer, size_t i_len)
int
fd
=
p_sys
->
fd
;
#if !defined (_WIN32) && !defined (__OS2__)
ssize_t
val
=
net_Read
(
p_access
,
fd
,
NULL
,
p_buffer
,
i_len
,
false
);
ssize_t
val
=
net_Read
(
p_access
,
fd
,
p_buffer
,
i_len
,
false
);
#else
ssize_t
val
=
read
(
fd
,
p_buffer
,
i_len
);
#endif
...
...
modules/access/ftp.c
View file @
c0cdab15
...
...
@@ -827,7 +827,7 @@ static ssize_t Read( access_t *p_access, uint8_t *p_buffer, size_t i_len )
if
(
p_sys
->
data
.
p_tls
!=
NULL
)
i_read
=
vlc_tls_Read
(
p_sys
->
data
.
p_tls
,
p_buffer
,
i_len
,
false
);
else
i_read
=
net_Read
(
p_access
,
p_sys
->
data
.
fd
,
NULL
,
p_buffer
,
i_len
,
false
);
i_read
=
net_Read
(
p_access
,
p_sys
->
data
.
fd
,
p_buffer
,
i_len
,
false
);
if
(
i_read
==
0
)
p_access
->
info
.
b_eof
=
true
;
else
if
(
i_read
>
0
)
...
...
modules/access/http.c
View file @
c0cdab15
...
...
@@ -672,7 +672,7 @@ static int ReadData( access_t *p_access, int *pi_read,
if
(
p_sys
->
p_tls
!=
NULL
)
*
pi_read
=
vlc_tls_Read
(
p_sys
->
p_tls
,
p_buffer
,
i_len
,
false
);
else
*
pi_read
=
net_Read
(
p_access
,
p_sys
->
fd
,
NULL
,
p_buffer
,
i_len
,
false
);
*
pi_read
=
net_Read
(
p_access
,
p_sys
->
fd
,
p_buffer
,
i_len
,
false
);
if
(
*
pi_read
<=
0
)
return
VLC_SUCCESS
;
...
...
modules/access/mms/mmsh.c
View file @
c0cdab15
...
...
@@ -932,7 +932,7 @@ static int GetPacket( access_t * p_access, chunk_t *p_ck )
* (4 bytes), decode and then read up to 8 additional bytes to get the
* entire header.
*/
if
(
net_Read
(
p_access
,
p_sys
->
fd
,
NULL
,
p_sys
->
buffer
,
4
,
true
)
<
4
)
if
(
net_Read
(
p_access
,
p_sys
->
fd
,
p_sys
->
buffer
,
4
,
true
)
<
4
)
{
msg_Err
(
p_access
,
"cannot read data 2"
);
return
VLC_EGENERIC
;
...
...
@@ -945,7 +945,7 @@ static int GetPacket( access_t * p_access, chunk_t *p_ck )
if
(
restsize
>
8
)
restsize
=
8
;
if
(
net_Read
(
p_access
,
p_sys
->
fd
,
NULL
,
p_sys
->
buffer
+
4
,
restsize
,
true
)
<
restsize
)
if
(
net_Read
(
p_access
,
p_sys
->
fd
,
p_sys
->
buffer
+
4
,
restsize
,
true
)
<
restsize
)
{
msg_Err
(
p_access
,
"cannot read data 3"
);
return
VLC_EGENERIC
;
...
...
@@ -996,7 +996,7 @@ static int GetPacket( access_t * p_access, chunk_t *p_ck )
}
if
(
(
p_ck
->
i_data
>
0
)
&&
(
net_Read
(
p_access
,
p_sys
->
fd
,
NULL
,
&
p_sys
->
buffer
[
12
],
(
net_Read
(
p_access
,
p_sys
->
fd
,
&
p_sys
->
buffer
[
12
],
p_ck
->
i_data
,
true
)
<
p_ck
->
i_data
)
)
{
msg_Err
(
p_access
,
"cannot read data 4"
);
...
...
modules/access/rtsp/access.c
View file @
c0cdab15
...
...
@@ -106,7 +106,7 @@ static int RtspRead( void *p_userdata, uint8_t *p_buffer, int i_buffer )
access_t
*
p_access
=
(
access_t
*
)
p_userdata
;
access_sys_t
*
p_sys
=
p_access
->
p_sys
;
return
net_Read
(
p_access
,
p_sys
->
fd
,
0
,
p_buffer
,
i_buffer
,
true
);
return
net_Read
(
p_access
,
p_sys
->
fd
,
p_buffer
,
i_buffer
,
true
);
}
static
int
RtspReadLine
(
void
*
p_userdata
,
uint8_t
*
p_buffer
,
int
i_buffer
)
...
...
modules/access/tcp.c
View file @
c0cdab15
...
...
@@ -138,8 +138,7 @@ static ssize_t Read( access_t *p_access, uint8_t *p_buffer, size_t i_len )
if
(
p_access
->
info
.
b_eof
)
return
0
;
i_read
=
net_Read
(
p_access
,
p_sys
->
fd
,
NULL
,
p_buffer
,
i_len
,
false
);
i_read
=
net_Read
(
p_access
,
p_sys
->
fd
,
p_buffer
,
i_len
,
false
);
if
(
i_read
==
0
)
p_access
->
info
.
b_eof
=
true
;
else
if
(
i_read
>
0
)
...
...
modules/access/udp.c
View file @
c0cdab15
...
...
@@ -268,7 +268,7 @@ static void* ThreadRead( void *data )
block_cleanup_push
(
pkt
);
do
len
=
net_Read
(
access
,
sys
->
fd
,
NULL
,
pkt
->
p_buffer
,
MTU
,
false
);
len
=
net_Read
(
access
,
sys
->
fd
,
pkt
->
p_buffer
,
MTU
,
false
);
while
(
len
==
-
1
&&
errno
!=
EINTR
);
vlc_cleanup_pop
();
...
...
modules/control/oldrc.c
View file @
c0cdab15
...
...
@@ -1877,7 +1877,7 @@ bool ReadCommand( intf_thread_t *p_intf, char *p_buffer, int *pi_size )
while
(
*
pi_size
<
MAX_LINE_LENGTH
&&
(
i_read
=
net_Read
(
p_intf
,
p_intf
->
p_sys
->
i_socket
==
-
1
?
0
/*STDIN_FILENO*/
:
p_intf
->
p_sys
->
i_socket
,
NULL
,
0
/*STDIN_FILENO*/
:
p_intf
->
p_sys
->
i_socket
,
(
uint8_t
*
)
p_buffer
+
*
pi_size
,
1
,
false
)
)
>
0
)
{
if
(
p_buffer
[
*
pi_size
]
==
'\r'
||
p_buffer
[
*
pi_size
]
==
'\n'
)
...
...
modules/demux/adaptative/http/Sockets.cpp
View file @
c0cdab15
...
...
@@ -63,7 +63,7 @@ ssize_t Socket::read(vlc_object_t *stream, void *p_buffer, size_t len)
ssize_t
size
;
do
{
size
=
net_Read
(
stream
,
netfd
,
NULL
,
p_buffer
,
len
,
true
);
size
=
net_Read
(
stream
,
netfd
,
p_buffer
,
len
,
true
);
}
while
(
size
<
0
&&
(
errno
==
EINTR
||
errno
==
EAGAIN
)
);
return
size
;
}
...
...
modules/stream_filter/decomp.c
View file @
c0cdab15
...
...
@@ -216,7 +216,7 @@ static int Read (stream_t *stream, void *buf, unsigned int buflen)
}
assert
((
buf
!=
NULL
)
||
(
buflen
==
0
));
ssize_t
val
=
net_Read
(
stream
,
sys
->
read_fd
,
NULL
,
buf
,
buflen
,
false
);
ssize_t
val
=
net_Read
(
stream
,
sys
->
read_fd
,
buf
,
buflen
,
false
);
if
(
val
>
0
)
{
sys
->
offset
+=
val
;
...
...
@@ -254,7 +254,7 @@ static int Peek (stream_t *stream, const uint8_t **pbuf, unsigned int len)
{
ssize_t
val
;
val
=
net_Read
(
stream
,
sys
->
read_fd
,
NULL
,
val
=
net_Read
(
stream
,
sys
->
read_fd
,
peeked
->
p_buffer
+
curlen
,
len
-
curlen
,
false
);
if
(
val
<=
0
)
break
;
...
...
modules/video_filter/remoteosd.c
View file @
c0cdab15
...
...
@@ -383,9 +383,7 @@ static bool read_exact( filter_t *p_filter,
char
*
p_readbuf
,
int
i_bytes
)
{
return
i_bytes
==
net_Read
(
p_filter
,
i_socket
,
NULL
,
(
unsigned
char
*
)
p_readbuf
,
i_bytes
,
true
);
return
i_bytes
==
net_Read
(
p_filter
,
i_socket
,
p_readbuf
,
i_bytes
,
true
);
}
...
...
src/network/io.c
View file @
c0cdab15
...
...
@@ -258,7 +258,7 @@ int *net_Listen (vlc_object_t *p_this, const char *psz_host,
* object has been signaled.
*****************************************************************************/
ssize_t
net_Read
(
vlc_object_t
*
restrict
p_this
,
int
fd
,
const
v_socket_t
*
vs
,
net_Read
(
vlc_object_t
*
restrict
p_this
,
int
fd
,
void
*
restrict
p_buf
,
size_t
i_buflen
,
bool
waitall
)
{
struct
pollfd
ufd
[
2
];
...
...
@@ -274,30 +274,17 @@ net_Read (vlc_object_t *restrict p_this, int fd, const v_socket_t *vs,
* before poll() starts an asynchronous transfer and returns 0.
* Always call poll() first.
*
* However if we have a virtual socket handler, try to read() first.
* See bug #8972 for details.
*/
if
(
vs
==
NULL
)
goto
do_poll
;
#endif
do
{
ssize_t
n
;
if
(
vs
!=
NULL
)
{
int
canc
=
vlc_savecancel
();
n
=
vs
->
pf_recv
(
vs
->
p_sys
,
p_buf
,
i_buflen
);
vlc_restorecancel
(
canc
);
}
else
{
#ifdef _WIN32
n
=
recv
(
fd
,
p_buf
,
i_buflen
,
0
);
ssize_t
n
=
recv
(
fd
,
p_buf
,
i_buflen
,
0
);
#else
n
=
read
(
fd
,
p_buf
,
i_buflen
);
ssize_t
n
=
read
(
fd
,
p_buf
,
i_buflen
);
#endif
}
if
(
n
<
0
)
{
switch
(
net_errno
)
...
...
@@ -485,7 +472,7 @@ char *net_Gets(vlc_object_t *obj, int fd)
bufsize
+=
1024
;
}
ssize_t
val
=
net_Read
(
obj
,
fd
,
NULL
,
buf
+
buflen
,
1
,
false
);
ssize_t
val
=
net_Read
(
obj
,
fd
,
buf
+
buflen
,
1
,
false
);
if
(
val
<
1
)
goto
error
;
...
...
src/network/tcp.c
View file @
c0cdab15
...
...
@@ -363,7 +363,7 @@ static int SocksNegotiate( vlc_object_t *p_obj,
if
(
net_Write
(
p_obj
,
fd
,
NULL
,
buffer
,
i_len
)
!=
i_len
)
return
VLC_EGENERIC
;
if
(
net_Read
(
p_obj
,
fd
,
NULL
,
buffer
,
2
,
true
)
!=
2
)
if
(
net_Read
(
p_obj
,
fd
,
buffer
,
2
,
true
)
!=
2
)
return
VLC_EGENERIC
;
msg_Dbg
(
p_obj
,
"socks: v=%d method=%x"
,
buffer
[
0
],
buffer
[
1
]
);
...
...
@@ -390,7 +390,7 @@ static int SocksNegotiate( vlc_object_t *p_obj,
if
(
net_Write
(
p_obj
,
fd
,
NULL
,
buffer
,
i_len
)
!=
i_len
)
return
VLC_EGENERIC
;
if
(
net_Read
(
p_obj
,
fd
,
NULL
,
buffer
,
2
,
true
)
!=
2
)
if
(
net_Read
(
p_obj
,
fd
,
buffer
,
2
,
true
)
!=
2
)
return
VLC_EGENERIC
;
msg_Dbg
(
p_obj
,
"socks: v=%d status=%x"
,
buffer
[
0
],
buffer
[
1
]
);
...
...
@@ -462,7 +462,7 @@ static int SocksHandshakeTCP( vlc_object_t *p_obj,
if
(
net_Write
(
p_obj
,
fd
,
NULL
,
buffer
,
9
)
!=
9
)
return
VLC_EGENERIC
;
if
(
net_Read
(
p_obj
,
fd
,
NULL
,
buffer
,
8
,
true
)
!=
8
)
if
(
net_Read
(
p_obj
,
fd
,
buffer
,
8
,
true
)
!=
8
)
return
VLC_EGENERIC
;
msg_Dbg
(
p_obj
,
"socks: v=%d cd=%d"
,
...
...
@@ -492,7 +492,7 @@ static int SocksHandshakeTCP( vlc_object_t *p_obj,
return
VLC_EGENERIC
;
/* Read the header */
if
(
net_Read
(
p_obj
,
fd
,
NULL
,
buffer
,
5
,
true
)
!=
5
)
if
(
net_Read
(
p_obj
,
fd
,
buffer
,
5
,
true
)
!=
5
)
return
VLC_EGENERIC
;
msg_Dbg
(
p_obj
,
"socks: v=%d rep=%d atyp=%d"
,
...
...
@@ -514,7 +514,7 @@ static int SocksHandshakeTCP( vlc_object_t *p_obj,
else
return
VLC_EGENERIC
;
if
(
net_Read
(
p_obj
,
fd
,
NULL
,
buffer
,
i_len
,
true
)
!=
i_len
)
if
(
net_Read
(
p_obj
,
fd
,
buffer
,
i_len
,
true
)
!=
i_len
)
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