conn: added API xmpp_conn_is_secured()

This patch is provided by @kjkao. New API is already used in
WorksSystems/wks_xep0047.
This commit is contained in:
Dmitry Podgorny
2015-10-13 00:10:02 +03:00
parent 36af7afa27
commit b7fbc81740
4 changed files with 13 additions and 1 deletions

View File

@@ -788,6 +788,12 @@ void xmpp_conn_set_old_style_ssl(xmpp_conn_t * const conn)
conn->tls_is_old_ssl = 1;
}
/** Returns whether TLS session is established or not. */
int xmpp_conn_is_secured(xmpp_conn_t * const conn)
{
return conn->secured && !conn->tls_failed ? 1 : 0;
}
static void _log_open_tag(xmpp_conn_t *conn, char **attrs)
{
char buf[4096];