show better error when running in server_mode with port 5347

This commit is contained in:
HanzZ 2013-01-04 16:49:34 +01:00
parent 86d0268f93
commit 7cd2083d81
2 changed files with 9 additions and 1 deletions

View file

@ -708,6 +708,10 @@ void NetworkPluginServer::handleConvMessageAckPayload(const std::string &data) {
if (!user)
return;
if (payload.id().empty()) {
LOG4CXX_WARN(logger, "Received message ack with empty ID, not forwarding to XMPP.");
return;
}
boost::shared_ptr<Swift::Message> msg(new Swift::Message());
msg->addPayload(boost::make_shared<Swift::DeliveryReceipt>(payload.id()));

View file

@ -231,8 +231,12 @@ void Component::handleConnected() {
void Component::handleServerStopped(boost::optional<Swift::BoostConnectionServer::Error> e) {
if(e != NULL ) {
if(*e == Swift::BoostConnectionServer::Conflict)
if(*e == Swift::BoostConnectionServer::Conflict) {
LOG4CXX_INFO(logger, "Port "<< CONFIG_INT(m_config, "service.port") << " already in use! Stopping server..");
if (CONFIG_INT(m_config, "service.port") == 5347) {
LOG4CXX_INFO(logger, "Port 5347 is usually used for components. You are using server_mode=1. Are you sure you don't want to use server_mode=0 and run spectrum as component?");
}
}
if(*e == Swift::BoostConnectionServer::UnknownError)
LOG4CXX_INFO(logger, "Unknown error occured! Stopping server..");
exit(1);