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
3aee65c9
Commit
3aee65c9
authored
May 12, 2015
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove no longer used net_Write() argument
parent
c0cdab15
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
20 additions
and
30 deletions
+20
-30
include/vlc_network.h
include/vlc_network.h
+2
-2
modules/access/ftp.c
modules/access/ftp.c
+2
-2
modules/access/http.c
modules/access/http.c
+1
-1
modules/access/mms/mmstu.c
modules/access/mms/mmstu.c
+1
-1
modules/demux/adaptative/http/Sockets.cpp
modules/demux/adaptative/http/Sockets.cpp
+1
-1
modules/stream_out/raop.c
modules/stream_out/raop.c
+3
-5
modules/video_filter/remoteosd.c
modules/video_filter/remoteosd.c
+1
-2
src/network/io.c
src/network/io.c
+5
-12
src/network/tcp.c
src/network/tcp.c
+4
-4
No files found.
include/vlc_network.h
View file @
3aee65c9
...
@@ -145,8 +145,8 @@ struct virtual_socket_t
...
@@ -145,8 +145,8 @@ struct virtual_socket_t
VLC_API
ssize_t
net_Read
(
vlc_object_t
*
p_this
,
int
fd
,
void
*
p_data
,
size_t
i_data
,
bool
b_retry
);
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)
#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
v
oid
*
p_data
,
size_t
i_data
);
VLC_API
ssize_t
net_Write
(
vlc_object_t
*
p_this
,
int
fd
,
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
)
#define net_Write(a,b,c,d
) net_Write(VLC_OBJECT(a),b,c,d
)
VLC_API
char
*
net_Gets
(
vlc_object_t
*
p_this
,
int
fd
);
VLC_API
char
*
net_Gets
(
vlc_object_t
*
p_this
,
int
fd
);
#define net_Gets(a,b) net_Gets(VLC_OBJECT(a),b)
#define net_Gets(a,b) net_Gets(VLC_OBJECT(a),b)
...
...
modules/access/ftp.c
View file @
3aee65c9
...
@@ -169,7 +169,7 @@ static int ftp_SendCommand( vlc_object_t *obj, access_sys_t *sys,
...
@@ -169,7 +169,7 @@ static int ftp_SendCommand( vlc_object_t *obj, access_sys_t *sys,
msg_Dbg
(
obj
,
"sending request:
\"
%.*s
\"
(%d bytes)"
,
val
-
2
,
cmd
,
val
);
msg_Dbg
(
obj
,
"sending request:
\"
%.*s
\"
(%d bytes)"
,
val
-
2
,
cmd
,
val
);
if
(
((
sys
->
cmd
.
p_tls
!=
NULL
)
if
(
((
sys
->
cmd
.
p_tls
!=
NULL
)
?
vlc_tls_Write
(
sys
->
cmd
.
p_tls
,
cmd
,
val
)
?
vlc_tls_Write
(
sys
->
cmd
.
p_tls
,
cmd
,
val
)
:
net_Write
(
obj
,
sys
->
cmd
.
fd
,
NULL
,
cmd
,
val
))
!=
val
)
:
net_Write
(
obj
,
sys
->
cmd
.
fd
,
cmd
,
val
))
!=
val
)
{
{
msg_Err
(
obj
,
"request failure"
);
msg_Err
(
obj
,
"request failure"
);
val
=
-
1
;
val
=
-
1
;
...
@@ -901,7 +901,7 @@ static ssize_t Write( sout_access_out_t *p_access, block_t *p_buffer )
...
@@ -901,7 +901,7 @@ static ssize_t Write( sout_access_out_t *p_access, block_t *p_buffer )
i_write
+=
vlc_tls_Write
(
p_sys
->
data
.
p_tls
,
i_write
+=
vlc_tls_Write
(
p_sys
->
data
.
p_tls
,
p_buffer
->
p_buffer
,
p_buffer
->
i_buffer
);
p_buffer
->
p_buffer
,
p_buffer
->
i_buffer
);
else
else
i_write
+=
net_Write
(
p_access
,
p_sys
->
data
.
fd
,
NULL
,
i_write
+=
net_Write
(
p_access
,
p_sys
->
data
.
fd
,
p_buffer
->
p_buffer
,
p_buffer
->
i_buffer
);
p_buffer
->
p_buffer
,
p_buffer
->
i_buffer
);
block_Release
(
p_buffer
);
block_Release
(
p_buffer
);
...
...
modules/access/http.c
View file @
3aee65c9
...
@@ -1007,7 +1007,7 @@ static int WriteHeaders( access_t *access, const char *fmt, ... )
...
@@ -1007,7 +1007,7 @@ static int WriteHeaders( access_t *access, const char *fmt, ... )
{
{
if
(
((
sys
->
p_tls
!=
NULL
)
if
(
((
sys
->
p_tls
!=
NULL
)
?
vlc_tls_Write
(
sys
->
p_tls
,
str
,
len
)
?
vlc_tls_Write
(
sys
->
p_tls
,
str
,
len
)
:
net_Write
(
access
,
sys
->
fd
,
NULL
,
str
,
len
))
<
len
)
:
net_Write
(
access
,
sys
->
fd
,
str
,
len
))
<
len
)
len
=
-
1
;
len
=
-
1
;
free
(
str
);
free
(
str
);
}
}
...
...
modules/access/mms/mmstu.c
View file @
3aee65c9
...
@@ -994,7 +994,7 @@ static int mms_CommandSend( access_t *p_access, int i_command,
...
@@ -994,7 +994,7 @@ static int mms_CommandSend( access_t *p_access, int i_command,
/* send it */
/* send it */
vlc_mutex_lock
(
&
p_sys
->
lock_netwrite
);
vlc_mutex_lock
(
&
p_sys
->
lock_netwrite
);
i_ret
=
net_Write
(
p_access
,
p_sys
->
i_handle_tcp
,
NULL
,
buffer
.
p_data
,
i_ret
=
net_Write
(
p_access
,
p_sys
->
i_handle_tcp
,
buffer
.
p_data
,
buffer
.
i_data
-
(
8
-
(
i_data
-
i_data_old
)
)
);
buffer
.
i_data
-
(
8
-
(
i_data
-
i_data_old
)
)
);
vlc_mutex_unlock
(
&
p_sys
->
lock_netwrite
);
vlc_mutex_unlock
(
&
p_sys
->
lock_netwrite
);
...
...
modules/demux/adaptative/http/Sockets.cpp
View file @
3aee65c9
...
@@ -86,7 +86,7 @@ bool Socket::send(vlc_object_t *stream, const void *buf, size_t size)
...
@@ -86,7 +86,7 @@ bool Socket::send(vlc_object_t *stream, const void *buf, size_t size)
if
(
size
==
0
)
if
(
size
==
0
)
return
true
;
return
true
;
return
net_Write
(
stream
,
netfd
,
NULL
,
buf
,
size
)
==
(
ssize_t
)
size
;
return
net_Write
(
stream
,
netfd
,
buf
,
size
)
==
(
ssize_t
)
size
;
}
}
TLSSocket
::
TLSSocket
()
:
Socket
()
TLSSocket
::
TLSSocket
()
:
Socket
()
...
...
modules/stream_out/raop.c
View file @
3aee65c9
...
@@ -805,7 +805,7 @@ static int SendRequest( vlc_object_t *p_this, const char *psz_method,
...
@@ -805,7 +805,7 @@ static int SendRequest( vlc_object_t *p_this, const char *psz_method,
if
(
i_err
!=
VLC_SUCCESS
)
if
(
i_err
!=
VLC_SUCCESS
)
goto
error
;
goto
error
;
i_rc
=
net_Write
(
p_this
,
p_sys
->
i_control_fd
,
NULL
,
i_rc
=
net_Write
(
p_this
,
p_sys
->
i_control_fd
,
psz_headers_end
,
sizeof
(
psz_headers_end
)
-
1
);
psz_headers_end
,
sizeof
(
psz_headers_end
)
-
1
);
if
(
i_rc
<
0
)
if
(
i_rc
<
0
)
{
{
...
@@ -814,8 +814,7 @@ static int SendRequest( vlc_object_t *p_this, const char *psz_method,
...
@@ -814,8 +814,7 @@ static int SendRequest( vlc_object_t *p_this, const char *psz_method,
}
}
if
(
psz_body
)
if
(
psz_body
)
net_Write
(
p_this
,
p_sys
->
i_control_fd
,
NULL
,
net_Write
(
p_this
,
p_sys
->
i_control_fd
,
psz_body
,
i_body_length
);
psz_body
,
i_body_length
);
error:
error:
return
i_err
;
return
i_err
;
...
@@ -1349,8 +1348,7 @@ static void SendAudio( sout_stream_t *p_stream, block_t *p_buffer )
...
@@ -1349,8 +1348,7 @@ static void SendAudio( sout_stream_t *p_stream, block_t *p_buffer )
goto
error
;
goto
error
;
/* Send data */
/* Send data */
rc
=
net_Write
(
p_stream
,
p_sys
->
i_stream_fd
,
NULL
,
rc
=
net_Write
(
p_stream
,
p_sys
->
i_stream_fd
,
p_sys
->
p_sendbuf
,
i_len
);
p_sys
->
p_sendbuf
,
i_len
);
if
(
rc
<
0
)
if
(
rc
<
0
)
goto
error
;
goto
error
;
...
...
modules/video_filter/remoteosd.c
View file @
3aee65c9
...
@@ -392,8 +392,7 @@ static bool write_exact( filter_t *p_filter,
...
@@ -392,8 +392,7 @@ static bool write_exact( filter_t *p_filter,
char
*
p_writebuf
,
char
*
p_writebuf
,
int
i_bytes
)
int
i_bytes
)
{
{
return
i_bytes
==
net_Write
(
p_filter
,
i_socket
,
NULL
,
return
i_bytes
==
net_Write
(
p_filter
,
i_socket
,
p_writebuf
,
i_bytes
);
(
unsigned
char
*
)
p_writebuf
,
i_bytes
);
}
}
static
bool
open_vnc_connection
(
filter_t
*
p_filter
)
static
bool
open_vnc_connection
(
filter_t
*
p_filter
)
...
...
src/network/io.c
View file @
3aee65c9
...
@@ -357,13 +357,12 @@ error:
...
@@ -357,13 +357,12 @@ error:
* Writes data to a file descriptor.
* Writes data to a file descriptor.
* This blocks until all data is written or an error occurs.
* This blocks until all data is written or an error occurs.
*
*
* This function is a cancellation point if p_vs is NULL.
* This function is a cancellation point.
* This function is not cancellation-safe if p_vs is not NULL.
*
*
* @return the total number of bytes written, or -1 if an error occurs
* @return the total number of bytes written, or -1 if an error occurs
* before any data is written.
* before any data is written.
*/
*/
ssize_t
net_Write
(
vlc_object_t
*
p_this
,
int
fd
,
const
v_socket_t
*
p_vs
,
ssize_t
net_Write
(
vlc_object_t
*
p_this
,
int
fd
,
const
void
*
restrict
p_data
,
size_t
i_data
)
const
void
*
restrict
p_data
,
size_t
i_data
)
{
{
size_t
i_total
=
0
;
size_t
i_total
=
0
;
...
@@ -380,8 +379,6 @@ ssize_t net_Write( vlc_object_t *p_this, int fd, const v_socket_t *p_vs,
...
@@ -380,8 +379,6 @@ ssize_t net_Write( vlc_object_t *p_this, int fd, const v_socket_t *p_vs,
while
(
i_data
>
0
)
while
(
i_data
>
0
)
{
{
ssize_t
val
;
ufd
[
0
].
revents
=
ufd
[
1
].
revents
=
0
;
ufd
[
0
].
revents
=
ufd
[
1
].
revents
=
0
;
if
(
poll
(
ufd
,
sizeof
(
ufd
)
/
sizeof
(
ufd
[
0
]),
-
1
)
==
-
1
)
if
(
poll
(
ufd
,
sizeof
(
ufd
)
/
sizeof
(
ufd
[
0
]),
-
1
)
==
-
1
)
...
@@ -410,15 +407,11 @@ ssize_t net_Write( vlc_object_t *p_this, int fd, const v_socket_t *p_vs,
...
@@ -410,15 +407,11 @@ ssize_t net_Write( vlc_object_t *p_this, int fd, const v_socket_t *p_vs,
}
}
}
}
if
(
p_vs
!=
NULL
)
val
=
p_vs
->
pf_send
(
p_vs
->
p_sys
,
p_data
,
i_data
);
else
#ifdef _WIN32
#ifdef _WIN32
val
=
send
(
fd
,
p_data
,
i_data
,
0
);
ssize_t
val
=
send
(
fd
,
p_data
,
i_data
,
0
);
#else
#else
val
=
write
(
fd
,
p_data
,
i_data
);
ssize_t
val
=
write
(
fd
,
p_data
,
i_data
);
#endif
#endif
if
(
val
==
-
1
)
if
(
val
==
-
1
)
{
{
if
(
errno
==
EINTR
)
if
(
errno
==
EINTR
)
...
@@ -513,7 +506,7 @@ ssize_t net_vaPrintf( vlc_object_t *p_this, int fd,
...
@@ -513,7 +506,7 @@ ssize_t net_vaPrintf( vlc_object_t *p_this, int fd,
int
i_size
=
vasprintf
(
&
psz
,
psz_fmt
,
args
);
int
i_size
=
vasprintf
(
&
psz
,
psz_fmt
,
args
);
if
(
i_size
==
-
1
)
if
(
i_size
==
-
1
)
return
-
1
;
return
-
1
;
i_ret
=
net_Write
(
p_this
,
fd
,
NULL
,
psz
,
i_size
)
<
i_size
i_ret
=
net_Write
(
p_this
,
fd
,
psz
,
i_size
)
<
i_size
?
-
1
:
i_size
;
?
-
1
:
i_size
;
free
(
psz
);
free
(
psz
);
...
...
src/network/tcp.c
View file @
3aee65c9
...
@@ -361,7 +361,7 @@ static int SocksNegotiate( vlc_object_t *p_obj,
...
@@ -361,7 +361,7 @@ static int SocksNegotiate( vlc_object_t *p_obj,
i_len
=
3
;
i_len
=
3
;
}
}
if
(
net_Write
(
p_obj
,
fd
,
NULL
,
buffer
,
i_len
)
!=
i_len
)
if
(
net_Write
(
p_obj
,
fd
,
buffer
,
i_len
)
!=
i_len
)
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
if
(
net_Read
(
p_obj
,
fd
,
buffer
,
2
,
true
)
!=
2
)
if
(
net_Read
(
p_obj
,
fd
,
buffer
,
2
,
true
)
!=
2
)
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
...
@@ -387,7 +387,7 @@ static int SocksNegotiate( vlc_object_t *p_obj,
...
@@ -387,7 +387,7 @@ static int SocksNegotiate( vlc_object_t *p_obj,
i_len
=
3
+
i_len1
+
i_len2
;
i_len
=
3
+
i_len1
+
i_len2
;
if
(
net_Write
(
p_obj
,
fd
,
NULL
,
buffer
,
i_len
)
!=
i_len
)
if
(
net_Write
(
p_obj
,
fd
,
buffer
,
i_len
)
!=
i_len
)
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
if
(
net_Read
(
p_obj
,
fd
,
buffer
,
2
,
true
)
!=
2
)
if
(
net_Read
(
p_obj
,
fd
,
buffer
,
2
,
true
)
!=
2
)
...
@@ -460,7 +460,7 @@ static int SocksHandshakeTCP( vlc_object_t *p_obj,
...
@@ -460,7 +460,7 @@ static int SocksHandshakeTCP( vlc_object_t *p_obj,
buffer
[
8
]
=
0
;
/* Empty user id */
buffer
[
8
]
=
0
;
/* Empty user id */
if
(
net_Write
(
p_obj
,
fd
,
NULL
,
buffer
,
9
)
!=
9
)
if
(
net_Write
(
p_obj
,
fd
,
buffer
,
9
)
!=
9
)
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
if
(
net_Read
(
p_obj
,
fd
,
buffer
,
8
,
true
)
!=
8
)
if
(
net_Read
(
p_obj
,
fd
,
buffer
,
8
,
true
)
!=
8
)
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
...
@@ -488,7 +488,7 @@ static int SocksHandshakeTCP( vlc_object_t *p_obj,
...
@@ -488,7 +488,7 @@ static int SocksHandshakeTCP( vlc_object_t *p_obj,
i_len
=
5
+
i_hlen
+
2
;
i_len
=
5
+
i_hlen
+
2
;
if
(
net_Write
(
p_obj
,
fd
,
NULL
,
buffer
,
i_len
)
!=
i_len
)
if
(
net_Write
(
p_obj
,
fd
,
buffer
,
i_len
)
!=
i_len
)
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
/* Read the header */
/* Read the header */
...
...
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