happy_eyeballs: propagate actual connection error

This commit is contained in:
Astro 2018-09-08 01:35:26 +02:00
commit ce2ce363b0
3 changed files with 31 additions and 19 deletions

View file

@ -64,10 +64,8 @@ impl Client {
done(Connecter::from_lookup(&domain, Some("_xmpp-client._tcp"), 5222))
.map_err(Error::Connection)
)
.and_then(|connecter|
connecter
.map_err(Error::Connection)
).and_then(move |tcp_stream|
.flatten()
.and_then(move |tcp_stream|
xmpp_stream::XMPPStream::start(tcp_stream, jid1, NS_JABBER_CLIENT.to_owned())
).and_then(|xmpp_stream| {
if Self::can_starttls(&xmpp_stream) {