Fix Windows compile error

This commit is contained in:
badaix 2025-01-27 22:49:59 +01:00
parent 85e8d02e5b
commit c105fecc5b
2 changed files with 28 additions and 3 deletions

View file

@ -368,10 +368,10 @@ int main(int argc, char** argv)
namespace fs = std::filesystem;
settings.server.certificate = fs::weakly_canonical(settings.server.certificate);
if (!fs::exists(settings.server.certificate))
throw SnapException("Certificate file not found: " + settings.server.certificate.native());
throw SnapException("Certificate file not found: " + settings.server.certificate.string());
settings.server.certificate_key = fs::weakly_canonical(settings.server.certificate_key);
if (!fs::exists(settings.server.certificate_key))
throw SnapException("Certificate_key file not found: " + settings.server.certificate_key.native());
throw SnapException("Certificate_key file not found: " + settings.server.certificate_key.string());
}
else if (settings.server.certificate.empty() != settings.server.certificate_key.empty())
{

View file

@ -28,7 +28,7 @@
#include <string>
#include <vector>
/// Server settings
struct ServerSettings
{
/// Launch settings
@ -70,6 +70,7 @@ struct ServerSettings
/// User settings
struct User
{
/// c'tor
explicit User(const std::string& user_permissions_password)
{
std::string perm;
@ -78,8 +79,11 @@ struct ServerSettings
permissions = utils::string::split(perm, ',');
}
/// user name
std::string name;
/// permissions
std::vector<std::string> permissions;
/// password
std::string password;
};
@ -87,36 +91,57 @@ struct ServerSettings
/// HTTP settings
struct Http
{
/// enable HTTP server
bool enabled{true};
/// enable HTTPS
bool ssl_enabled{false};
/// HTTP port
size_t port{1780};
/// HTTPS port
size_t ssl_port{1788};
/// HTTP listen address
std::vector<std::string> bind_to_address{{"::"}};
/// HTTPS listen address
std::vector<std::string> ssl_bind_to_address{{"::"}};
/// doc root directory
std::string doc_root;
/// HTTP server host name
std::string host{"<hostname>"};
/// URL prefix when serving album art
std::string url_prefix;
};
/// TCP streaming client settings
struct Tcp
{
/// enable plain TCP audio streaming
bool enabled{true};
/// TCP port
size_t port{1705};
/// TCP listen addresses
std::vector<std::string> bind_to_address{{"::"}};
};
/// Stream settings
struct Stream
{
/// Audio streaming port
size_t port{1704};
/// Directory for stream plugins
std::filesystem::path plugin_dir{"/usr/share/snapserver/plug-ins"};
/// Stream sources
std::vector<std::string> sources;
/// Default codec
std::string codec{"flac"};
/// Default end to end delay
int32_t bufferMs{1000};
/// Default sample format
std::string sampleFormat{"48000:16:2"};
/// Default read size for stream sources
size_t streamChunkMs{20};
/// Send audio to muted clients?
bool sendAudioToMutedClients{false};
/// Liste addresses
std::vector<std::string> bind_to_address{{"::"}};
};