[vlc-commits] network: fix net_Read() documentation and match it in code
Rémi Denis-Courmont
git at videolan.org
Wed Jul 1 18:22:13 CEST 2015
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Jun 30 23:52:51 2015 +0300| [27bb0783c4c0c5cb1a24f3dc7f85b77d191a1b9c] | committer: Rémi Denis-Courmont
network: fix net_Read() documentation and match it in code
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=27bb0783c4c0c5cb1a24f3dc7f85b77d191a1b9c
---
src/network/io.c | 17 ++++++-----------
1 file changed, 6 insertions(+), 11 deletions(-)
diff --git a/src/network/io.c b/src/network/io.c
index b488082..fc88395 100644
--- a/src/network/io.c
+++ b/src/network/io.c
@@ -224,13 +224,12 @@ int *net_Listen (vlc_object_t *p_this, const char *psz_host,
return sockv;
}
-/*****************************************************************************
- * net_Read:
- *****************************************************************************
- * Reads from a network socket. Cancellation point.
- * We repeat until we have read the right amount of data;
- * a short count means EOF has been reached or an error.
- *****************************************************************************/
+/**
+ * Reads data from a socket, blocking until all requested data is received or
+ * the end of the stream is reached.
+ * This function is a cancellation point.
+ * @return -1 on error, or the number of bytes of read.
+ */
ssize_t (net_Read)(vlc_object_t *restrict obj, int fd,
void *restrict buf, size_t len)
{
@@ -245,11 +244,7 @@ ssize_t (net_Read)(vlc_object_t *restrict obj, int fd,
return -1;
}
-#ifndef _WIN32
- ssize_t val = vlc_read_i11e(fd, buf, len);
-#else
ssize_t val = vlc_recv_i11e(fd, buf, len, 0);
-#endif
if (val < 0)
{
if (errno == EINTR || errno == EAGAIN)
More information about the vlc-commits
mailing list