mirror of
https://codeberg.org/wownero/lwsf-wow.git
synced 2026-10-17 05:41:30 +02:00
Add default port selection
This commit is contained in:
@@ -807,6 +807,13 @@ namespace lwsf { namespace internal
|
||||
epee::net_utils::ssl_support_t::e_ssl_support_enabled
|
||||
};
|
||||
|
||||
if (!url.port)
|
||||
{
|
||||
if ((use_ssl || https))
|
||||
url.port = 443;
|
||||
else
|
||||
url.port = 80;
|
||||
}
|
||||
data_->client.set_server(std::move(url.host), std::to_string(url.port), std::move(login), std::move(options));
|
||||
}
|
||||
catch (const std::exception& e)
|
||||
|
||||
@@ -398,14 +398,19 @@ namespace lwsf
|
||||
if (!url.m_uri_content.m_path.empty())
|
||||
throw std::runtime_error{"LWS URL contains path (unsupported)"};
|
||||
|
||||
bool use_ssl = false;
|
||||
if (url.schema == "https")
|
||||
use_ssl = true;
|
||||
|
||||
const bool use_ssl = (url.schema == "https");
|
||||
epee::net_utils::ssl_options_t options{
|
||||
use_ssl ? epee::net_utils::ssl_support_t::e_ssl_support_enabled : epee::net_utils::ssl_support_t::e_ssl_support_disabled
|
||||
};
|
||||
|
||||
if (!url.port)
|
||||
{
|
||||
if (use_ssl)
|
||||
url.port = 443;
|
||||
else
|
||||
url.port = 80;
|
||||
}
|
||||
|
||||
client_.set_server(std::move(url.host), std::to_string(url.port), boost::none, std::move(options));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user