If hostname resolution fails, do not try all possible ports

This commit is contained in:
Florent Le Coz
2015-07-09 15:30:24 +02:00
parent ac6a74595c
commit ece4b4969b
3 changed files with 13 additions and 3 deletions
+5
View File
@@ -72,6 +72,11 @@ void IrcClient::on_connection_failed(const std::string& reason)
{
this->bridge->send_xmpp_message(this->hostname, "",
"Connection failed: "s + reason);
if (this->hostname_resolution_failed)
while (!this->ports_to_try.empty())
this->ports_to_try.pop();
if (this->ports_to_try.empty())
{
// Send an error message for all room that the user wanted to join