[vlc-commits] http: use vlc_tls_GetPollFD()

Rémi Denis-Courmont git at videolan.org
Sun Nov 18 16:57:10 CET 2018


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Nov 17 21:47:39 2018 +0200| [f0b4dd00a8303a40044f5ad9ae6399a11fed39ec] | committer: Rémi Denis-Courmont

http: use vlc_tls_GetPollFD()

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f0b4dd00a8303a40044f5ad9ae6399a11fed39ec
---

 modules/access/http/h2conn.c   | 7 ++++---
 modules/access/http/h2output.c | 7 ++++---
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/modules/access/http/h2conn.c b/modules/access/http/h2conn.c
index 4aa96c16f0..f6110c768d 100644
--- a/modules/access/http/h2conn.c
+++ b/modules/access/http/h2conn.c
@@ -551,12 +551,9 @@ static const struct vlc_h2_parser_cbs vlc_h2_parser_callbacks =
  */
 static ssize_t vlc_https_recv(vlc_tls_t *tls, void *buf, size_t len)
 {
-    struct pollfd ufd;
     struct iovec iov;
     size_t count = 0;
 
-    ufd.fd = vlc_tls_GetFD(tls);
-    ufd.events = POLLIN;
     iov.iov_base = buf;
     iov.iov_len = len;
 
@@ -581,6 +578,10 @@ static ssize_t vlc_https_recv(vlc_tls_t *tls, void *buf, size_t len)
         if (errno != EINTR && errno != EAGAIN)
             return count ? (ssize_t)count : -1;
 
+        struct pollfd ufd;
+
+        ufd.events = POLLIN;
+        ufd.fd = vlc_tls_GetPollFD(tls, &ufd.events);
         poll(&ufd, 1, -1);
     }
 
diff --git a/modules/access/http/h2output.c b/modules/access/http/h2output.c
index 4ed8e33129..bfb41208ca 100644
--- a/modules/access/http/h2output.c
+++ b/modules/access/http/h2output.c
@@ -192,12 +192,9 @@ static void vlc_h2_output_flush_unlocked(struct vlc_h2_output *out)
  */
 static ssize_t vlc_https_send(vlc_tls_t *tls, const void *buf, size_t len)
 {
-    struct pollfd ufd;
     struct iovec iov;
     size_t count = 0;
 
-    ufd.fd = vlc_tls_GetFD(tls);
-    ufd.events = POLLOUT;
     iov.iov_base = (void *)buf;
     iov.iov_len = len;
 
@@ -222,6 +219,10 @@ static ssize_t vlc_https_send(vlc_tls_t *tls, const void *buf, size_t len)
         if (errno != EINTR && errno != EAGAIN)
             return count ? (ssize_t)count : -1;
 
+        struct pollfd ufd;
+
+        ufd.events = POLLOUT;
+        ufd.fd = vlc_tls_GetPollFD(tls, &ufd.events);
         poll(&ufd, 1, -1);
     }
 



More information about the vlc-commits mailing list