Commit ceb9edfa authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

TLS: attach before inheriting variables

parent f79d566e
...@@ -69,6 +69,7 @@ tls_ServerCreate (vlc_object_t *obj, const char *cert_path, ...@@ -69,6 +69,7 @@ tls_ServerCreate (vlc_object_t *obj, const char *cert_path,
var_SetString (srv, "tls-x509-key", key_path); var_SetString (srv, "tls-x509-key", key_path);
} }
vlc_object_attach (srv, obj);
srv->p_module = module_need (srv, "tls server", NULL, false ); srv->p_module = module_need (srv, "tls server", NULL, false );
if (srv->p_module == NULL) if (srv->p_module == NULL)
{ {
...@@ -77,7 +78,6 @@ tls_ServerCreate (vlc_object_t *obj, const char *cert_path, ...@@ -77,7 +78,6 @@ tls_ServerCreate (vlc_object_t *obj, const char *cert_path,
return NULL; return NULL;
} }
vlc_object_attach (srv, obj);
msg_Dbg (srv, "TLS server plugin initialized"); msg_Dbg (srv, "TLS server plugin initialized");
return srv; return srv;
} }
...@@ -184,6 +184,7 @@ tls_ClientCreate (vlc_object_t *obj, int fd, const char *psz_hostname) ...@@ -184,6 +184,7 @@ tls_ClientCreate (vlc_object_t *obj, int fd, const char *psz_hostname)
else else
msg_Dbg (cl, "requested anonymous server"); msg_Dbg (cl, "requested anonymous server");
vlc_object_attach (cl, obj);
cl->p_module = module_need (cl, "tls client", NULL, false ); cl->p_module = module_need (cl, "tls client", NULL, false );
if (cl->p_module == NULL) if (cl->p_module == NULL)
{ {
...@@ -201,7 +202,6 @@ tls_ClientCreate (vlc_object_t *obj, int fd, const char *psz_hostname) ...@@ -201,7 +202,6 @@ tls_ClientCreate (vlc_object_t *obj, int fd, const char *psz_hostname)
if (val == 0) if (val == 0)
{ {
msg_Dbg (cl, "TLS client session initialized"); msg_Dbg (cl, "TLS client session initialized");
vlc_object_attach (cl, obj);
return cl; return cl;
} }
msg_Err (cl, "TLS client session handshake error"); msg_Err (cl, "TLS client session handshake error");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment