Add config error on empty port in Endpoints

fixes #9623
This commit is contained in:
Jean Flach 2015-08-24 17:19:12 +02:00
parent f45f6ccd82
commit 9b05304435
2 changed files with 9 additions and 0 deletions

View File

@ -57,6 +57,14 @@ void Endpoint::OnAllConfigLoaded(void)
BOOST_THROW_EXCEPTION(ScriptError("Endpoint '" + GetName() + "' does not belong to a zone.", GetDebugInfo()));
}
void Endpoint::ValidatePort(const String& value, const ValidationUtils& utils)
{
ObjectImpl<Endpoint>::ValidatePort(value, utils);
if (value.IsEmpty())
BOOST_THROW_EXCEPTION(ValidationError(this, boost::assign::list_of("enpoint_port"), "Port may not be empty."));
}
void Endpoint::AddClient(const JsonRpcConnection::Ptr& client)
{
bool was_master = ApiListener::GetInstance()->IsMaster();

View File

@ -56,6 +56,7 @@ public:
protected:
virtual void OnAllConfigLoaded(void) override;
virtual void ValidatePort(const String& value, const ValidationUtils& utils) override;
private:
mutable boost::mutex m_ClientsLock;