Remote Access base on libstrophe
[platform/upstream/iotivity.git] / extlibs / libstrophe / strophe-xmpp_conn_is_secured.patch
1 diff --git a/src/conn.c b/src/conn.c
2 index d72386f..e4f0a39 100644
3 --- a/src/conn.c
4 +++ b/src/conn.c
5 @@ -742,6 +742,11 @@ void xmpp_conn_disable_tls(xmpp_conn_t * const conn)
6      conn->tls_disabled = 1;
7  }
8  
9 +int xmpp_conn_is_secured(xmpp_conn_t * const conn)
10 +{
11 +    return conn->secured == 1 && conn->tls_failed == 0 ? 1 : 0;
12 +}
13 +
14  static void _log_open_tag(xmpp_conn_t *conn, char **attrs)
15  {
16      char buf[4096];
17 diff --git a/strophe.h b/strophe.h
18 index 80a5390..64b2352 100644
19 --- a/strophe.h
20 +++ b/strophe.h
21 @@ -215,6 +215,7 @@ const char *xmpp_conn_get_pass(const xmpp_conn_t * const conn);
22  void xmpp_conn_set_pass(xmpp_conn_t * const conn, const char * const pass);
23  xmpp_ctx_t* xmpp_conn_get_context(xmpp_conn_t * const conn);
24  void xmpp_conn_disable_tls(xmpp_conn_t * const conn);
25 +int xmpp_conn_is_secured(xmpp_conn_t * const conn);
26  
27  int xmpp_connect_client(xmpp_conn_t * const conn, 
28                           const char * const altdomain,