mirror of
https://github.com/znc/znc.git
synced 2026-08-07 01:13:25 +02:00
The Listener of a RealListener is never NULL
This commit is contained in:
@@ -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
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user