The Listener of a RealListener is never NULL

This commit is contained in:
uu1101
2014-02-15 14:57:33 +01:00
parent 7a9ce630ef
commit d3ddb9b69d
2 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -71,7 +71,7 @@ protected:
class CRealListener : public CZNCSock {
public:
CRealListener(CListener *pParent) : CZNCSock(), m_pParent(pParent) {}
CRealListener(CListener& listener) : CZNCSock(), m_Listener(listener) {}
virtual ~CRealListener();
virtual bool ConnectionFrom(const CString& sHost, unsigned short uPort);
@@ -79,7 +79,7 @@ public:
virtual void SockError(int iErrno, const CString& sDescription);
private:
CListener* m_pParent;
CListener& m_Listener;
};
class CIncomingConnection : public CZNCSock {
+3 -3
View File
@@ -27,7 +27,7 @@ bool CListener::Listen() {
return false;
}
m_pListener = new CRealListener(this);
m_pListener = new CRealListener(*this);
bool bSSL = false;
#ifdef HAVE_LIBSSL
@@ -50,7 +50,7 @@ void CListener::ResetRealListener() {
}
CRealListener::~CRealListener() {
m_pParent->ResetRealListener();
m_Listener.ResetRealListener();
}
bool CRealListener::ConnectionFrom(const CString& sHost, unsigned short uPort) {
@@ -60,7 +60,7 @@ bool CRealListener::ConnectionFrom(const CString& sHost, unsigned short uPort) {
}
Csock* CRealListener::GetSockObj(const CString& sHost, unsigned short uPort) {
CIncomingConnection *pClient = new CIncomingConnection(sHost, uPort, m_pParent->GetAcceptType());
CIncomingConnection *pClient = new CIncomingConnection(sHost, uPort, m_Listener.GetAcceptType());
if (CZNC::Get().AllowConnectionFrom(sHost)) {
GLOBALMODULECALL(OnClientConnect(pClient, sHost, uPort), NOTHING);
} else {