X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/d903c02d2bba584ff806ae9d00973fa4418f77b8..1eda2370d8c666d9d61fd8f03fff24e2f444ec87:/projects/stargazer/plugins/configuration/sgconfig/configproto.cpp?ds=sidebyside diff --git a/projects/stargazer/plugins/configuration/sgconfig/configproto.cpp b/projects/stargazer/plugins/configuration/sgconfig/configproto.cpp index d28ece17..847e1ebc 100644 --- a/projects/stargazer/plugins/configuration/sgconfig/configproto.cpp +++ b/projects/stargazer/plugins/configuration/sgconfig/configproto.cpp @@ -230,9 +230,16 @@ void CONFIGPROTO::AcceptConnection() assert(m_users != NULL); assert(m_tariffs != NULL); - m_conns.push_back(new STG::Conn(*m_settings, *m_admins, *m_users, *m_tariffs, sock, outerAddr)); - - printfd(__FILE__, "New connection from %s:%d\n", inet_ntostring(m_conns.back()->IP()).c_str(), m_conns.back()->Port()); + try + { + m_conns.push_back(new STG::Conn(*m_settings, *m_admins, *m_users, *m_tariffs, sock, outerAddr)); + printfd(__FILE__, "New connection from %s:%d\n", inet_ntostring(m_conns.back()->IP()).c_str(), m_conns.back()->Port()); + } + catch (const STG::Conn::Error & error) + { + // Unlikely. + m_logger(std::string("Failed to create new client connection: '") + error.what() + "'."); + } } /* void CONFIGPROTO::WriteLogAccessFailed(uint32_t ip)