diff options
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | examples/dump-certificates.c | 16 | ||||
-rw-r--r-- | wocky/wocky-jingle-transport-iface.c | 12 | ||||
-rw-r--r-- | wocky/wocky-jingle-transport-iface.h | 5 |
4 files changed, 32 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac index d97dff7..ef3fd7c 100644 --- a/configure.ac +++ b/configure.ac @@ -173,7 +173,7 @@ if test x$prefer_stream_ciphers = xyes; then # We do this check here and not earlier to avoid accidentally falling # back to openssl because of the use of --enable-prefer-stream-ciphers. PKG_CHECK_MODULES(GNUTLS_FOR_STREAM_CIPHERS, [gnutls >= 2.12.0],[], - AC_MSG_ERROR([gnutls 2.12.0 is needed to use --enable-prefer-stream-cihpers])) + AC_MSG_ERROR([gnutls 2.12.0 is needed to use --enable-prefer-stream-ciphers])) fi fi diff --git a/examples/dump-certificates.c b/examples/dump-certificates.c index eb22fd7..41584a8 100644 --- a/examples/dump-certificates.c +++ b/examples/dump-certificates.c @@ -147,16 +147,26 @@ main (int argc, WockyConnector *connector; WockyTLSHandler *handler; + gchar* server = NULL; + guint port = 5222; + g_type_init (); wocky_init (); - if (argc != 2) + if (!(argc == 2 || argc == 4)) { - g_printerr ("Usage: %s <jid>\n", argv[0]); + g_printerr ("Usage: %s <jid> [<server> <port>]\n", argv[0]); return -1; } jid = argv[1]; + + if (argc == 4) + { + server = argv[2]; + port = atoi(argv[3]); + } + /* This example doesn't use your real password because it does not actually * validate certificates: it just dumps them then declares them valid. */ @@ -165,6 +175,8 @@ main (int argc, mainloop = g_main_loop_new (NULL, FALSE); handler = g_object_new (dump_tls_handler_get_type (), NULL); connector = wocky_connector_new (jid, password, NULL, NULL, handler); + if (argc == 4) + g_object_set (G_OBJECT (connector), "xmpp-server", server, "xmpp-port", port, NULL); wocky_connector_connect_async (connector, NULL, connected_cb, NULL); g_main_loop_run (mainloop); diff --git a/wocky/wocky-jingle-transport-iface.c b/wocky/wocky-jingle-transport-iface.c index 63a9339..06e3815 100644 --- a/wocky/wocky-jingle-transport-iface.c +++ b/wocky/wocky-jingle-transport-iface.c @@ -235,6 +235,10 @@ wocky_jingle_transport_iface_get_type (void) return type; } +G_DEFINE_BOXED_TYPE (WockyJingleCandidate, wocky_jingle_candidate, + wocky_jingle_candidate_copy, + wocky_jingle_candidate_free) + WockyJingleCandidate * wocky_jingle_candidate_new (WockyJingleTransportProtocol protocol, WockyJingleCandidateType type, const gchar *id, int component, @@ -258,6 +262,14 @@ wocky_jingle_candidate_new (WockyJingleTransportProtocol protocol, return c; } +WockyJingleCandidate * +wocky_jingle_candidate_copy (WockyJingleCandidate *c) +{ + return wocky_jingle_candidate_new (c->protocol, c->type, c->id, + c->component, c->address, c->port, c->generation, c->preference, + c->username, c->password, c->network); +} + void wocky_jingle_candidate_free (WockyJingleCandidate *c) { diff --git a/wocky/wocky-jingle-transport-iface.h b/wocky/wocky-jingle-transport-iface.h index 2b47d01..99e1a1a 100644 --- a/wocky/wocky-jingle-transport-iface.h +++ b/wocky/wocky-jingle-transport-iface.h @@ -97,11 +97,16 @@ gboolean jingle_transport_get_credentials (WockyJingleTransportIface *, WockyJingleTransportIface *wocky_jingle_transport_iface_new ( GType type, WockyJingleContent *content, const gchar *transport_ns); +#define WOCKY_TYPE_JINGLE_CANDIDATE \ + (wocky_jingle_candidate_get_type ()) +GType wocky_jingle_candidate_get_type (void); + WockyJingleCandidate *wocky_jingle_candidate_new (WockyJingleTransportProtocol protocol, WockyJingleCandidateType type, const gchar *id, int component, const gchar *address, int port, int generation, int preference, const gchar *username, const gchar *password, int network); +WockyJingleCandidate *wocky_jingle_candidate_copy (WockyJingleCandidate *c); void wocky_jingle_candidate_free (WockyJingleCandidate *c); void jingle_transport_free_candidates (GList *candidates); |