output/httpd: make configuration fields const

This commit is contained in:
Max Kellermann 2022-01-10 22:30:17 +01:00
parent 1ae6378d85
commit d79bf853b1
2 changed files with 11 additions and 12 deletions

View File

@ -121,15 +121,17 @@ private:
/**
* The configured name.
*/
char const *name;
char const *const name;
/**
* The configured genre.
*/
char const *genre;
char const *const genre;
/**
* The configured website address.
*/
char const *website;
char const *const website;
private:
/**
@ -147,7 +149,7 @@ private:
/**
* The maximum number of clients connected at the same time.
*/
unsigned clients_max;
const unsigned clients_max;
public:
HttpdOutput(EventLoop &_loop, const ConfigBlock &block);

View File

@ -43,15 +43,12 @@ HttpdOutput::HttpdOutput(EventLoop &_loop, const ConfigBlock &block)
:AudioOutput(FLAG_ENABLE_DISABLE|FLAG_PAUSE),
ServerSocket(_loop),
prepared_encoder(CreateConfiguredEncoder(block)),
defer_broadcast(_loop, BIND_THIS_METHOD(OnDeferredBroadcast))
defer_broadcast(_loop, BIND_THIS_METHOD(OnDeferredBroadcast)),
name(block.GetBlockValue("name", "Set name in config")),
genre(block.GetBlockValue("genre", "Set genre in config")),
website(block.GetBlockValue("website", "Set website in config")),
clients_max(block.GetBlockValue("max_clients", 0U))
{
/* read configuration */
name = block.GetBlockValue("name", "Set name in config");
genre = block.GetBlockValue("genre", "Set genre in config");
website = block.GetBlockValue("website", "Set website in config");
clients_max = block.GetBlockValue("max_clients", 0U);
/* set up bind_to_address */
ServerSocketAddGeneric(*this, block.GetBlockValue("bind_to_address"), block.GetBlockValue("port", 8000U));