[vlc-commits] https: use vlc_tls_Close()

Rémi Denis-Courmont git at videolan.org
Fri Dec 18 23:21:31 CET 2015


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri Dec 18 23:06:23 2015 +0200| [28fb341732e4bdf1b8bb3359f9cd5651a1be9d20] | committer: Rémi Denis-Courmont

https: use vlc_tls_Close()

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

 modules/access/http/connmgr.c   |    4 ++--
 modules/access/http/h1conn.c    |    6 +++---
 modules/access/http/h2conn.c    |    2 +-
 modules/access/http/transport.c |   16 ----------------
 modules/access/http/transport.h |    2 --
 5 files changed, 6 insertions(+), 24 deletions(-)

diff --git a/modules/access/http/connmgr.c b/modules/access/http/connmgr.c
index be352e1..815d610 100644
--- a/modules/access/http/connmgr.c
+++ b/modules/access/http/connmgr.c
@@ -170,7 +170,7 @@ struct vlc_http_msg *vlc_https_request(struct vlc_http_mgr *mgr,
         if (likely(conn2 != NULL))
             mgr->conn2 = conn2;
         else
-            vlc_https_disconnect(tls);
+            vlc_tls_Close(tls);
     }
     else /* TODO: HTTP/1.x support */
     {
@@ -178,7 +178,7 @@ struct vlc_http_msg *vlc_https_request(struct vlc_http_mgr *mgr,
         if (likely(conn1 != NULL))
             mgr->conn1 = conn1;
         else
-            vlc_https_disconnect(tls);
+            vlc_tls_Close(tls);
     }
 
     return vlc_https_request_reuse(mgr, host, port, req);
diff --git a/modules/access/http/h1conn.c b/modules/access/http/h1conn.c
index 847095c..2bf8130 100644
--- a/modules/access/http/h1conn.c
+++ b/modules/access/http/h1conn.c
@@ -124,7 +124,7 @@ static void vlc_h1_conn_destroy(struct vlc_h1_conn *conn);
 static void *vlc_h1_stream_fatal(struct vlc_h1_conn *conn)
 {
     msg_Dbg(CO(conn), "connection failed");
-    vlc_https_disconnect(conn->tls);
+    vlc_tls_Close(conn->tls);
     conn->tls = NULL;
     return NULL;
 }
@@ -242,7 +242,7 @@ static void vlc_h1_stream_close(struct vlc_http_stream *stream, bool abort)
 
     if (abort)
     {
-        vlc_https_disconnect(conn->tls);
+        vlc_tls_Close(conn->tls);
         conn->tls = NULL;
     }
 
@@ -277,7 +277,7 @@ static void vlc_h1_conn_destroy(struct vlc_h1_conn *conn)
     assert(conn->released);
 
     if (conn->tls != NULL)
-        vlc_https_disconnect(conn->tls);
+        vlc_tls_Close(conn->tls);
     free(conn);
 }
 
diff --git a/modules/access/http/h2conn.c b/modules/access/http/h2conn.c
index ad4d421..628f602 100644
--- a/modules/access/http/h2conn.c
+++ b/modules/access/http/h2conn.c
@@ -686,7 +686,7 @@ static void vlc_h2_conn_destroy(struct vlc_h2_conn *conn)
     vlc_mutex_destroy(&conn->lock);
 
     vlc_h2_output_destroy(conn->out);
-    vlc_https_disconnect(conn->tls);
+    vlc_tls_Close(conn->tls);
     free(conn);
 }
 
diff --git a/modules/access/http/transport.c b/modules/access/http/transport.c
index 32ca53b..0a9a738 100644
--- a/modules/access/http/transport.c
+++ b/modules/access/http/transport.c
@@ -131,19 +131,3 @@ vlc_tls_t *vlc_https_connect(vlc_tls_creds_t *creds, const char *name,
     free(alp);
     return tls;
 }
-
-void vlc_http_disconnect(int fd)
-{
-    shutdown(fd, SHUT_RDWR);
-    net_Close(fd);
-}
-
-void vlc_https_disconnect(vlc_tls_t *tls)
-{
-    int canc = vlc_savecancel();
-    int fd = tls->fd;
-
-    vlc_tls_SessionDelete(tls);
-    vlc_http_disconnect(fd);
-    vlc_restorecancel(canc);
-}
diff --git a/modules/access/http/transport.h b/modules/access/http/transport.h
index 9c32d91..bb6aa584 100644
--- a/modules/access/http/transport.h
+++ b/modules/access/http/transport.h
@@ -30,7 +30,5 @@ struct vlc_tls_creds;
 struct vlc_tls *vlc_https_connect(struct vlc_tls_creds *creds,
                                   const char *name, unsigned port,
                                   bool *restrict two);
-void vlc_http_disconnect(int fd);
-void vlc_https_disconnect(struct vlc_tls *tls);
 
 #endif



More information about the vlc-commits mailing list