From 299f52df3af8bc7dafcd9a5a6e12d31042734357 Mon Sep 17 00:00:00 2001 From: fiaxh Date: Thu, 17 Aug 2017 22:29:19 +0200 Subject: xmpp-vala: Connection fallback without SRV records --- xmpp-vala/src/core/xmpp_stream.vala | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'xmpp-vala/src/core') diff --git a/xmpp-vala/src/core/xmpp_stream.vala b/xmpp-vala/src/core/xmpp_stream.vala index a461b2cb..6bb66445 100644 --- a/xmpp-vala/src/core/xmpp_stream.vala +++ b/xmpp-vala/src/core/xmpp_stream.vala @@ -55,8 +55,12 @@ public class XmppStream { best_provider = connection_provider; } } - if (best_provider == null) throw new IOStreamError.CONNECT("no suitable connection provider"); - IOStream? stream = best_provider.connect(this); + IOStream? stream = null; + if (best_provider != null) { + stream = best_provider.connect(this); + } else { + stream = (new SocketClient()).connect(new NetworkService("xmpp-client", "tcp", this.remote_name)); + } if (stream == null) throw new IOStreamError.CONNECT("client.connect() returned null"); reset_stream((!)stream); } catch (Error e) { -- cgit v1.2.3-70-g09d2