[vlc-commits] securetransport: use destroy callback
Rémi Denis-Courmont
git at videolan.org
Sun Nov 18 16:57:21 CET 2018
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Nov 18 14:07:20 2018 +0200| [d00e368d0d52d5d0cc4c14e504c72bc9cce302b0] | committer: Rémi Denis-Courmont
securetransport: use destroy callback
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d00e368d0d52d5d0cc4c14e504c72bc9cce302b0
---
modules/misc/securetransport.c | 52 +++++++++++++++++++++---------------------
1 file changed, 26 insertions(+), 26 deletions(-)
diff --git a/modules/misc/securetransport.c b/modules/misc/securetransport.c
index 66ebff781a..4dd20018b0 100644
--- a/modules/misc/securetransport.c
+++ b/modules/misc/securetransport.c
@@ -87,17 +87,15 @@ static char* CFArrayALPNCopyFirst(CFArrayRef alpnArray)
* Module descriptor
*****************************************************************************/
static int OpenClient (vlc_tls_creds_t *);
-static void CloseClient (vlc_tls_creds_t *);
#if !TARGET_OS_IPHONE
static int OpenServer (vlc_tls_creds_t *crd, const char *cert, const char *key);
- static void CloseServer (vlc_tls_creds_t *);
#endif
vlc_module_begin ()
set_description(N_("TLS support for OS X and iOS"))
set_capability("tls client", 2)
- set_callbacks(OpenClient, CloseClient)
+ set_callbacks(OpenClient, NULL)
set_category(CAT_ADVANCED)
set_subcategory(SUBCAT_ADVANCED_NETWORK)
@@ -110,7 +108,7 @@ vlc_module_begin ()
add_submodule()
set_description(N_("TLS server support for OS X"))
set_capability("tls server", 2)
- set_callbacks(OpenServer, CloseServer)
+ set_callbacks(OpenServer, NULL)
set_category(CAT_ADVANCED)
set_subcategory(SUBCAT_ADVANCED_NETWORK)
#endif /* !TARGET_OS_IPHONE */
@@ -808,6 +806,17 @@ error:
return NULL;
}
+static void st_ClientDestroy (vlc_tls_creds_t *crd) {
+ msg_Dbg(crd, "close secure transport client");
+
+ vlc_tls_creds_sys_t *sys = crd->sys;
+
+ if (sys->whitelist)
+ CFRelease(sys->whitelist);
+
+ free(sys);
+}
+
/**
* Initializes a client-side TLS credentials.
*/
@@ -824,21 +833,11 @@ static int OpenClient (vlc_tls_creds_t *crd) {
crd->sys = sys;
crd->open = st_ClientSessionOpen;
+ crd->destroy = st_ClientDestroy;
return VLC_SUCCESS;
}
-static void CloseClient (vlc_tls_creds_t *crd) {
- msg_Dbg(crd, "close secure transport client");
-
- vlc_tls_creds_sys_t *sys = crd->sys;
-
- if (sys->whitelist)
- CFRelease(sys->whitelist);
-
- free(sys);
-}
-
/* Begin of server-side methods */
#if !TARGET_OS_IPHONE
@@ -873,6 +872,17 @@ error:
return NULL;
}
+static void st_ServerDestroy (vlc_tls_creds_t *crd) {
+ msg_Dbg(crd, "close secure transport server");
+
+ vlc_tls_creds_sys_t *sys = crd->sys;
+
+ if (sys->server_cert_chain)
+ CFRelease(sys->server_cert_chain);
+
+ free(sys);
+}
+
/**
* Initializes server-side TLS credentials.
*/
@@ -979,6 +989,7 @@ static int OpenServer (vlc_tls_creds_t *crd, const char *cert, const char *key)
crd->sys = sys;
crd->open = st_ServerSessionOpen;
+ crd->destroy = st_ServerDestroy;
out:
if (policy)
@@ -994,15 +1005,4 @@ out:
return result;
}
-static void CloseServer (vlc_tls_creds_t *crd) {
- msg_Dbg(crd, "close secure transport server");
-
- vlc_tls_creds_sys_t *sys = crd->sys;
-
- if (sys->server_cert_chain)
- CFRelease(sys->server_cert_chain);
-
- free(sys);
-}
-
#endif /* !TARGET_OS_IPHONE */
More information about the vlc-commits
mailing list