* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General
- * Public License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
- * Boston, MA 02111-1307, USA.
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
/**
* GTlsBackend:
*
- * Type implemented by TLS #GIOModules to provide access to additional
- * TLS-related types.
+ * TLS (Transport Layer Security, aka SSL) backend. This is an
+ * internal type used to coordinate the different classes implemented
+ * by a TLS backend.
*
* Since: 2.28
*/
{
}
-static gpointer
-get_default_tls_backend (gpointer arg)
-{
- const char *use_this;
- GList *extensions;
- GIOExtensionPoint *ep;
- GIOExtension *extension;
-
- _g_io_modules_ensure_loaded ();
-
- ep = g_io_extension_point_lookup (G_TLS_BACKEND_EXTENSION_POINT_NAME);
-
- use_this = g_getenv ("GIO_USE_TLS");
- if (use_this)
- {
- extension = g_io_extension_point_get_extension_by_name (ep, use_this);
- if (extension)
- return g_object_new (g_io_extension_get_type (extension), NULL);
- }
-
- extensions = g_io_extension_point_get_extensions (ep);
- if (extensions)
- {
- extension = extensions->data;
- return g_object_new (g_io_extension_get_type (extension), NULL);
- }
-
- return NULL;
-}
-
/**
* g_tls_backend_get_default:
*
GTlsBackend *
g_tls_backend_get_default (void)
{
- static GOnce once_init = G_ONCE_INIT;
-
- return g_once (&once_init, get_default_tls_backend, NULL);
+ return _g_io_module_get_default (G_TLS_BACKEND_EXTENSION_POINT_NAME,
+ "GIO_USE_TLS", NULL);
}
/**
* Checks if TLS is supported; if this returns %FALSE for the default
* #GTlsBackend, it means no "real" TLS backend is available.
*
- * Return value: whether or not TLS is supported
+ * Returns: whether or not TLS is supported
*
* Since: 2.28
*/
*
* Gets the default #GTlsDatabase used to verify TLS connections.
*
- * Return value: the default database, which should be unreffed when done.
+ * Returns: (transfer full): the default database, which should be
+ * unreffed when done.
*
* Since: 2.30
*/
*
* Gets the #GType of @backend's #GTlsCertificate implementation.
*
- * Return value: the #GType of @backend's #GTlsCertificate
+ * Returns: the #GType of @backend's #GTlsCertificate
* implementation.
*
* Since: 2.28
*
* Gets the #GType of @backend's #GTlsClientConnection implementation.
*
- * Return value: the #GType of @backend's #GTlsClientConnection
+ * Returns: the #GType of @backend's #GTlsClientConnection
* implementation.
*
* Since: 2.28
*
* Gets the #GType of @backend's #GTlsServerConnection implementation.
*
- * Return value: the #GType of @backend's #GTlsServerConnection
+ * Returns: the #GType of @backend's #GTlsServerConnection
* implementation.
*
* Since: 2.28
* g_tls_backend_get_file_database_type:
* @backend: the #GTlsBackend
*
- * Gets the #GTyep of @backend's #GTlsFileDatabase implementation.
+ * Gets the #GType of @backend's #GTlsFileDatabase implementation.
*
- * Return value: the #GType of backend's #GTlsFileDatabase implementation.
+ * Returns: the #GType of backend's #GTlsFileDatabase implementation.
*
* Since: 2.30
*/