mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
Added more columns to ListSockets() table and made CSocket::Connect() respect the ssl flag
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@379 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
16
Modules.cpp
16
Modules.cpp
@@ -125,7 +125,7 @@ CSocket::~CSocket() {
|
||||
|
||||
bool CSocket::Connect(const CString& sHostname, unsigned short uPort, bool bSSL, unsigned int uTimeout) {
|
||||
CString sSockName = "MOD::C::" + m_pModule->GetModName() + "::" + m_pModule->GetUser()->GetUserName();
|
||||
return m_pModule->GetManager()->Connect(sHostname, uPort, sSockName, uTimeout, false, m_pModule->GetUser()->GetVHost(), (Csock*) this);
|
||||
return m_pModule->GetManager()->Connect(sHostname, uPort, sSockName, uTimeout, bSSL, m_pModule->GetUser()->GetVHost(), (Csock*) this);
|
||||
}
|
||||
|
||||
bool CSocket::Listen(unsigned short uPort, bool bSSL, unsigned int uTimeout) {
|
||||
@@ -383,15 +383,27 @@ void CModule::ListSockets() {
|
||||
CTable Table;
|
||||
Table.AddColumn("Name");
|
||||
Table.AddColumn("State");
|
||||
Table.AddColumn("LocalPort");
|
||||
Table.AddColumn("SSL");
|
||||
Table.AddColumn("RemoteIP");
|
||||
Table.AddColumn("RemotePort");
|
||||
|
||||
for (unsigned int a = 0; a < m_vSockets.size(); a++) {
|
||||
CSocket* pSocket = (CSocket*) m_vSockets[a];
|
||||
|
||||
Table.AddRow();
|
||||
Table.SetCell("Name", pSocket->GetLabel());
|
||||
Table.SetCell("State", (pSocket->IsConnected() ? "Connected" : ""));
|
||||
|
||||
if (pSocket->GetType() == CSocket::LISTENER) {
|
||||
Table.SetCell("State", "Listening");
|
||||
} else {
|
||||
Table.SetCell("State", (pSocket->IsConnected() ? "Connected" : ""));
|
||||
}
|
||||
|
||||
Table.SetCell("LocalPort", CString::ToString(pSocket->GetLocalPort()));
|
||||
Table.SetCell("SSL", (pSocket->GetSSL() ? "yes" : "no"));
|
||||
Table.SetCell("RemoteIP", pSocket->GetRemoteIP());
|
||||
Table.SetCell("RemotePort", (pSocket->GetRemotePort()) ? CString::ToString(pSocket->GetRemotePort()) : CString(""));
|
||||
}
|
||||
|
||||
if (Table.size()) {
|
||||
|
||||
Reference in New Issue
Block a user