CShellSock(CShellMod* pShellMod, CClient* pClient, const CString& sExec) : CExecSock() { EnableReadLine(); m_pParent = pShellMod; m_pClient = pClient; if (Execute(sExec) == -1) { CString s = "Failed to execute: "; s += strerror(errno); ReadLine(s); return; } // Get rid of that write fd, we aren't going to use it // (And clients expecting input will fail this way). close(GetWSock()); SetWSock(open("/dev/null", O_WRONLY)); }
CDCCBounce::CDCCBounce(CBounceDCCMod* pMod, const CString& sHostname, unsigned short uPort, const CString& sRemoteNick, const CString& sRemoteIP, const CString& sFileName, int iTimeout, bool bIsChat) : CSocket(pMod, sHostname, uPort, iTimeout) { m_uRemotePort = 0; m_bIsChat = bIsChat; m_pModule = pMod; m_pPeer = NULL; m_sRemoteNick = sRemoteNick; m_sFileName = sFileName; m_sRemoteIP = sRemoteIP; m_bIsRemote = false; SetMaxBufferThreshold(10240); if (bIsChat) { EnableReadLine(); } else { DisableReadLine(); } }
CDCCBounce::CDCCBounce(CBounceDCCMod* pMod, unsigned long uLongIP, unsigned short uPort, const CString& sFileName, const CString& sRemoteNick, const CString& sRemoteIP, bool bIsChat) : CSocket(pMod) { m_uRemotePort = uPort; m_sConnectIP = CUtils::GetIP(uLongIP); m_sRemoteIP = sRemoteIP; m_sFileName = sFileName; m_sRemoteNick = sRemoteNick; m_pModule = pMod; m_bIsChat = bIsChat; m_sLocalIP = pMod->GetLocalDCCIP(); m_pPeer = NULL; m_bIsRemote = false; if (bIsChat) { EnableReadLine(); } else { DisableReadLine(); } }
CSocket::CSocket(CModule* pModule, const CString& sHostname, unsigned short uPort, int iTimeout) : CZNCSock(sHostname, uPort, iTimeout), m_pModule(pModule) { if (m_pModule) m_pModule->AddSocket(this); EnableReadLine(); SetMaxBufferThreshold(10240); }
/////////////////// CSocket /////////////////// CSocket::CSocket(CModule* pModule) : CZNCSock(), m_pModule(pModule) { if (m_pModule) m_pModule->AddSocket(this); EnableReadLine(); SetMaxBufferThreshold(10240); }
CIdentAcceptedSocket::CIdentAcceptedSocket(CModule *pMod) : CSocket(pMod) { EnableReadLine(); }