From: RĂ©mi Denis-Courmont Date: Thu, 27 Nov 2008 16:52:48 +0000 (+0200) Subject: net_Read: cancel-safety X-Git-Tag: 1.0.0-pre1~2016 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=031dd3fed7f444acd1855b49a4b545666b38de82;p=vlc net_Read: cancel-safety --- diff --git a/src/network/io.c b/src/network/io.c index ed069b3d19..edf6a63c23 100644 --- a/src/network/io.c +++ b/src/network/io.c @@ -281,7 +281,7 @@ int *net_Listen (vlc_object_t *p_this, const char *psz_host, /***************************************************************************** * __net_Read: ***************************************************************************** - * Reads from a network socket. + * Reads from a network socket. Cancellation point. * If waitall is true, then we repeat until we have read the right amount of * data; in that case, a short count means EOF has been reached or the VLC * object has been signaled. @@ -343,7 +343,9 @@ __net_Read (vlc_object_t *restrict p_this, int fd, const v_socket_t *vs, ssize_t n; if (vs != NULL) { + int canc = vlc_savecancel (); n = vs->pf_recv (vs->p_sys, p_buf, i_buflen); + canc = vlc_restorecancel (canc); } else {