/** The creator/owner of this object
*/
InspIRCd* ServerInstance;
+ std::string desc;
public:
/** Create a new listening socket
*/
/** Close the socket
*/
~ListenSocket();
+ /** Set descriptive text
+ */
+ void SetDescription(const std::string &description)
+ {
+ desc = description;
+ }
+
+ const std::string& GetDescription()
+ {
+ return desc;
+ }
};
#endif
case 'p':
{
std::map<int,int> pc;
-
for (std::vector<userrec*>::const_iterator i = ServerInstance->local_users.begin(); i != ServerInstance->local_users.end(); i++)
{
userrec* t = (userrec*)(*i);
if (t->registered == REG_ALL)
pc[t->GetPort()]++;
}
-
for (unsigned int i = 0; i < ServerInstance->stats->BoundPortCount; i++)
{
results.push_back(sn+" 249 "+user->nick+" :p:"+ConvToStr(ServerInstance->Config->ports[i])+" (" + ConvToStr(pc[ServerInstance->Config->ports[i]])+" client" +
- (pc[ServerInstance->Config->ports[i]] != 1 ? "s" : "") + ")");
+ (pc[ServerInstance->Config->ports[i]] != 1 ? "s" : "") + "), "+ServerInstance->Config->openSockfd[i]->GetDescription());
}
}
break;
if (ServerInstance->Config->AddIOHook(portno, this))
{
listenports.push_back(portno);
+ for (unsigned int i = 0; i < ServerInstance->stats->BoundPortCount; i++)
+ if (ServerInstance->Config->ports[i])
+ ServerInstance->Config->openSockfd[i]->SetDescription("ssl");
ServerInstance->Log(DEFAULT, "m_ssl_gnutls.so: Enabling SSL for port %d", portno);
}
else
if (ServerInstance->Config->AddIOHook(portno, this))
{
listenports.push_back(portno);
+ for (unsigned int i = 0; i < ServerInstance->stats->BoundPortCount; i++)
+ if (ServerInstance->Config->ports[i])
+ ServerInstance->Config->openSockfd[i]->SetDescription("ssl");
ServerInstance->Log(DEFAULT, "m_ssl_openssl.so: Enabling SSL for port %d", portno);
}
else
};
-ListenSocket::ListenSocket(InspIRCd* Instance, int sockfd, insp_sockaddr client, insp_sockaddr server, int port, char* addr) : ServerInstance(Instance)
+ListenSocket::ListenSocket(InspIRCd* Instance, int sockfd, insp_sockaddr client, insp_sockaddr server, int port, char* addr) : ServerInstance(Instance), desc("plaintext")
{
this->SetFd(sockfd);
Instance->Log(DEBUG,"Binding to port %s:%d",addr,port);