vlc | branch: master | Rémi Denis-Courmont <[email protected]> | Tue May 12 22:10:44 2015 +0300| [3aee65c9f779e569bcf6fb70fbfd18c0ee14d982] | committer: Rémi Denis-Courmont
Remove no longer used net_Write() argument > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3aee65c9f779e569bcf6fb70fbfd18c0ee14d982 --- include/vlc_network.h | 4 ++-- modules/access/ftp.c | 4 ++-- modules/access/http.c | 2 +- modules/access/mms/mmstu.c | 2 +- modules/demux/adaptative/http/Sockets.cpp | 2 +- modules/stream_out/raop.c | 8 +++----- modules/video_filter/remoteosd.c | 3 +-- src/network/io.c | 17 +++++------------ src/network/tcp.c | 8 ++++---- 9 files changed, 20 insertions(+), 30 deletions(-) diff --git a/include/vlc_network.h b/include/vlc_network.h index b27b28b..b6bd56c 100644 --- a/include/vlc_network.h +++ b/include/vlc_network.h @@ -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 ); #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 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) net_Write(VLC_OBJECT(a),b,c,d) VLC_API char * net_Gets( vlc_object_t *p_this, int fd ); #define net_Gets(a,b) net_Gets(VLC_OBJECT(a),b) diff --git a/modules/access/ftp.c b/modules/access/ftp.c index 84888bb..cf80c14 100644 --- a/modules/access/ftp.c +++ b/modules/access/ftp.c @@ -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 ); if( ((sys->cmd.p_tls != NULL) ? 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" ); val = -1; @@ -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, p_buffer->p_buffer, p_buffer->i_buffer ); 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 ); block_Release( p_buffer ); diff --git a/modules/access/http.c b/modules/access/http.c index 49681c2..4659453 100644 --- a/modules/access/http.c +++ b/modules/access/http.c @@ -1007,7 +1007,7 @@ static int WriteHeaders( access_t *access, const char *fmt, ... ) { if( ((sys->p_tls != NULL) ? 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; free( str ); } diff --git a/modules/access/mms/mmstu.c b/modules/access/mms/mmstu.c index 4c0a8c2..48b2723 100644 --- a/modules/access/mms/mmstu.c +++ b/modules/access/mms/mmstu.c @@ -994,7 +994,7 @@ static int mms_CommandSend( access_t *p_access, int i_command, /* send it */ 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 ) ) ); vlc_mutex_unlock( &p_sys->lock_netwrite ); diff --git a/modules/demux/adaptative/http/Sockets.cpp b/modules/demux/adaptative/http/Sockets.cpp index 03b70c6..8b0f2d7 100644 --- a/modules/demux/adaptative/http/Sockets.cpp +++ b/modules/demux/adaptative/http/Sockets.cpp @@ -86,7 +86,7 @@ bool Socket::send(vlc_object_t *stream, const void *buf, size_t size) if (size == 0) 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() diff --git a/modules/stream_out/raop.c b/modules/stream_out/raop.c index 415ad5a..014cb36 100644 --- a/modules/stream_out/raop.c +++ b/modules/stream_out/raop.c @@ -805,7 +805,7 @@ static int SendRequest( vlc_object_t *p_this, const char *psz_method, if ( i_err != VLC_SUCCESS ) 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 ); if ( i_rc < 0 ) { @@ -814,8 +814,7 @@ static int SendRequest( vlc_object_t *p_this, const char *psz_method, } if ( psz_body ) - net_Write( p_this, p_sys->i_control_fd, NULL, - psz_body, i_body_length ); + net_Write( p_this, p_sys->i_control_fd, psz_body, i_body_length ); error: return i_err; @@ -1349,8 +1348,7 @@ static void SendAudio( sout_stream_t *p_stream, block_t *p_buffer ) goto error; /* Send data */ - rc = net_Write( p_stream, p_sys->i_stream_fd, NULL, - p_sys->p_sendbuf, i_len ); + rc = net_Write( p_stream, p_sys->i_stream_fd, p_sys->p_sendbuf, i_len ); if ( rc < 0 ) goto error; diff --git a/modules/video_filter/remoteosd.c b/modules/video_filter/remoteosd.c index b26990d..f53bba1 100644 --- a/modules/video_filter/remoteosd.c +++ b/modules/video_filter/remoteosd.c @@ -392,8 +392,7 @@ static bool write_exact( filter_t *p_filter, char* p_writebuf, int i_bytes ) { - return i_bytes == net_Write( p_filter, i_socket, NULL, - (unsigned char*)p_writebuf, i_bytes ); + return i_bytes == net_Write( p_filter, i_socket, p_writebuf, i_bytes ); } static bool open_vnc_connection ( filter_t *p_filter ) diff --git a/src/network/io.c b/src/network/io.c index ccf10cd..586765d 100644 --- a/src/network/io.c +++ b/src/network/io.c @@ -357,13 +357,12 @@ error: * Writes data to a file descriptor. * 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 not cancellation-safe if p_vs is not NULL. + * This function is a cancellation point. * * @return the total number of bytes written, or -1 if an error occurs * 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 ) { 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, while( i_data > 0 ) { - ssize_t val; - ufd[0].revents = ufd[1].revents = 0; 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, } } - if (p_vs != NULL) - val = p_vs->pf_send (p_vs->p_sys, p_data, i_data); - else #ifdef _WIN32 - val = send (fd, p_data, i_data, 0); + ssize_t val = send (fd, p_data, i_data, 0); #else - val = write (fd, p_data, i_data); + ssize_t val = write (fd, p_data, i_data); #endif - if (val == -1) { if (errno == EINTR) @@ -513,7 +506,7 @@ ssize_t net_vaPrintf( vlc_object_t *p_this, int fd, int i_size = vasprintf( &psz, psz_fmt, args ); if( i_size == -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; free( psz ); diff --git a/src/network/tcp.c b/src/network/tcp.c index 23c6072..98bb3fd 100644 --- a/src/network/tcp.c +++ b/src/network/tcp.c @@ -361,7 +361,7 @@ static int SocksNegotiate( vlc_object_t *p_obj, 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; if( net_Read( p_obj, fd, buffer, 2, true ) != 2 ) return VLC_EGENERIC; @@ -387,7 +387,7 @@ static int SocksNegotiate( vlc_object_t *p_obj, 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; if( net_Read( p_obj, fd, buffer, 2, true ) != 2 ) @@ -460,7 +460,7 @@ static int SocksHandshakeTCP( vlc_object_t *p_obj, 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; if( net_Read( p_obj, fd, buffer, 8, true ) != 8 ) return VLC_EGENERIC; @@ -488,7 +488,7 @@ static int SocksHandshakeTCP( vlc_object_t *p_obj, 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; /* Read the header */ _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
