# include "config.h"
#endif
-#include <vlc/vlc.h>
+#include <vlc_common.h>
#include "libvlc.h"
#include <vlc_tls.h>
+#include <vlc_modules.h>
/**
* Allocates a whole server's TLS credentials.
var_SetString (srv, "tls-x509-key", key_path);
}
- srv->p_module = module_Need (srv, "tls server", 0, 0);
+ srv->p_module = module_need (srv, "tls server", NULL, false );
if (srv->p_module == NULL)
{
msg_Err (srv, "TLS server plugin not available");
- vlc_object_destroy (srv);
+ vlc_object_release (srv);
return NULL;
}
- vlc_object_attach (srv, obj);
msg_Dbg (srv, "TLS server plugin initialized");
return srv;
}
if (srv == NULL)
return;
- module_Unneed (srv, srv->p_module);
- vlc_object_detach (srv);
- vlc_object_destroy (srv);
+ module_unneed (srv, srv->p_module);
+ vlc_object_release (srv);
}
tls_session_t *tls_ServerSessionPrepare (tls_server_t *srv)
{
- tls_session_t *ses;
-
- ses = srv->pf_open (srv);
- if (ses == NULL)
- return NULL;
-
- vlc_object_attach (ses, srv);
- return ses;
+ return srv->pf_open (srv);
}
else
msg_Dbg (cl, "requested anonymous server");
- cl->p_module = module_Need (cl, "tls client", 0, 0);
+ cl->p_module = module_need (cl, "tls client", NULL, false );
if (cl->p_module == NULL)
{
msg_Err (cl, "TLS client plugin not available");
- vlc_object_destroy (cl);
+ vlc_object_release (cl);
return NULL;
}
if (val == 0)
{
msg_Dbg (cl, "TLS client session initialized");
- vlc_object_attach (cl, obj);
return cl;
}
msg_Err (cl, "TLS client session handshake error");
- module_Unneed (cl, cl->p_module);
- vlc_object_destroy (cl);
+ module_unneed (cl, cl->p_module);
+ vlc_object_release (cl);
return NULL;
}
if (cl == NULL)
return;
- module_Unneed (cl, cl->p_module);
- vlc_object_detach (cl);
- vlc_object_destroy (cl);
+ module_unneed (cl, cl->p_module);
+ vlc_object_release (cl);
}