[vlc-commits] tls: document vlc_tls_SessionDelete()
Rémi Denis-Courmont
git at videolan.org
Fri Dec 18 23:21:30 CET 2015
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri Dec 18 23:03:28 2015 +0200| [0ac1b96be0d643ed6a0e11db70d58e20eee2fab2] | committer: Rémi Denis-Courmont
tls: document vlc_tls_SessionDelete()
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0ac1b96be0d643ed6a0e11db70d58e20eee2fab2
---
include/vlc_tls.h | 10 ++++++++++
src/network/tls.c | 5 ++++-
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/include/vlc_tls.h b/include/vlc_tls.h
index f2a44ae..af9bc0c 100644
--- a/include/vlc_tls.h
+++ b/include/vlc_tls.h
@@ -72,6 +72,16 @@ VLC_API vlc_tls_t *vlc_tls_ClientSessionCreate (vlc_tls_creds_t *, int fd,
vlc_tls_t *vlc_tls_SessionCreate (vlc_tls_creds_t *, int fd, const char *host,
const char *const *alpn);
+
+/**
+ * Shuts a TLS session down.
+ *
+ * Shuts a TLS session down (if it was succesfully established) and releases
+ * all resources. The underlying connection is preserved. Use vlc_tls_Close()
+ * instead to shut it down at the same.
+ *
+ * This function is non-blocking and is not a cancellation point.
+ */
VLC_API void vlc_tls_SessionDelete (vlc_tls_t *);
VLC_API int vlc_tls_Read(vlc_tls_t *, void *buf, size_t len, bool waitall);
diff --git a/src/network/tls.c b/src/network/tls.c
index 9120a27..1c926ab 100644
--- a/src/network/tls.c
+++ b/src/network/tls.c
@@ -149,7 +149,10 @@ vlc_tls_t *vlc_tls_SessionCreate (vlc_tls_creds_t *crd, int fd,
void vlc_tls_SessionDelete (vlc_tls_t *session)
{
- session->close (session);
+ int canc = vlc_savecancel();
+ session->close(session);
+ vlc_restorecancel(canc);
+
free(session);
}
More information about the vlc-commits
mailing list