mirror of
https://github.com/LizardByte/Sunshine.git
synced 2026-12-01 17:41:12 +00:00
fix(hostname): fix handling of non-ASCII hostnames on Windows (#3382)
This commit is contained in:
1 parent
d552073eaf
commit
fb1f5b5a89
8 files changed
+51
-5
No files matched your search
@@ -15,6 +15,7 @@
|
||||
// lib includes
|
||||
#include <arpa/inet.h>
|
||||
#include <boost/asio/ip/address.hpp>
|
||||
#include <boost/asio/ip/host_name.hpp>
|
||||
#include <boost/process/v1.hpp>
|
||||
#include <dlfcn.h>
|
||||
#include <fcntl.h>
|
||||
@@ -797,6 +798,17 @@ namespace platf {
|
||||
return std::make_unique<qos_t>(sockfd, reset_options);
|
||||
}
|
||||
|
||||
std::string
|
||||
get_host_name() {
|
||||
try {
|
||||
return boost::asio::ip::host_name();
|
||||
}
|
||||
catch (boost::system::system_error &err) {
|
||||
BOOST_LOG(error) << "Failed to get hostname: "sv << err.what();
|
||||
return "Sunshine"s;
|
||||
}
|
||||
}
|
||||
|
||||
namespace source {
|
||||
enum source_e : std::size_t {
|
||||
#ifdef SUNSHINE_BUILD_CUDA
|
||||
|
||||
Reference in new issue
Block a user