aboutsummaryrefslogtreecommitdiff
path: root/xmpp-vala/src/module/xep
diff options
context:
space:
mode:
authorfiaxh <git@mx.ax.lt>2017-10-29 15:15:28 +0100
committerfiaxh <git@mx.ax.lt>2017-10-31 15:41:45 +0100
commit0102abeec1d2055b19dccbb7edc7f06e527642b1 (patch)
tree4018e82224c19142c4a7a6eced67d9c2550b2dd8 /xmpp-vala/src/module/xep
parentb9df78e4494879752e9e68dcc5d54e03fffe9467 (diff)
downloaddino-0102abeec1d2055b19dccbb7edc7f06e527642b1.tar.gz
dino-0102abeec1d2055b19dccbb7edc7f06e527642b1.zip
Fix warnings
Diffstat (limited to 'xmpp-vala/src/module/xep')
-rw-r--r--xmpp-vala/src/module/xep/0368_srv_records_tls.vala12
1 files changed, 8 insertions, 4 deletions
diff --git a/xmpp-vala/src/module/xep/0368_srv_records_tls.vala b/xmpp-vala/src/module/xep/0368_srv_records_tls.vala
index 154e8a4f..4c24c63e 100644
--- a/xmpp-vala/src/module/xep/0368_srv_records_tls.vala
+++ b/xmpp-vala/src/module/xep/0368_srv_records_tls.vala
@@ -37,10 +37,14 @@ public class TlsConnectionProvider : ConnectionProvider {
public override IOStream? connect(XmppStream stream) {
SocketClient client = new SocketClient();
- IOStream? io_stream = client.connect_to_host(srv_target.get_hostname(), srv_target.get_port());
- io_stream = TlsClientConnection.new(io_stream, new NetworkAddress(srv_target.get_hostname(), srv_target.get_port()));
- stream.add_flag(new Tls.Flag() { finished=true });
- return io_stream;
+ try {
+ IOStream? io_stream = client.connect_to_host(srv_target.get_hostname(), srv_target.get_port());
+ io_stream = TlsClientConnection.new(io_stream, new NetworkAddress(srv_target.get_hostname(), srv_target.get_port()));
+ stream.add_flag(new Tls.Flag() { finished=true });
+ return io_stream;
+ } catch (Error e) {
+ return null;
+ }
}
public override string get_id() { return "start_tls"; }