mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2026-03-18 11:23:38 +00:00
DSU: Don't crash on bad hostname
This commit is contained in:
parent
63fc9d7ca3
commit
80762e0575
@ -260,11 +260,18 @@ void InputBackend::HotplugThreadFunc()
|
||||
list_ports.pad_request_count = SERVER_ASKED_PADS;
|
||||
list_ports.pad_ids = {0, 1, 2, 3};
|
||||
msg.Finish();
|
||||
if (server.m_socket.send(&list_ports, sizeof list_ports,
|
||||
sf::IpAddress::resolve(server.m_address).value(),
|
||||
server.m_port) != sf::Socket::Status::Done)
|
||||
if (std::optional<sf::IpAddress> server_ip = sf::IpAddress::resolve(server.m_address))
|
||||
{
|
||||
ERROR_LOG_FMT(CONTROLLERINTERFACE, "DualShockUDPClient HotplugThreadFunc send failed");
|
||||
if (server.m_socket.send(&list_ports, sizeof list_ports, *server_ip, server.m_port) !=
|
||||
sf::Socket::Status::Done)
|
||||
{
|
||||
ERROR_LOG_FMT(CONTROLLERINTERFACE, "DualShockUDPClient HotplugThreadFunc send failed");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ERROR_LOG_FMT(CONTROLLERINTERFACE, "DualShockUDPClient failed to resolve {}",
|
||||
server.m_address);
|
||||
}
|
||||
timed_out_servers[i] = true;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user