Example #1
0
	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));
	}
Example #2
0
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();
    }
}
Example #3
0
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();
    }
}
Example #4
0
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);
}
Example #5
0
/////////////////// CSocket ///////////////////
CSocket::CSocket(CModule* pModule) : CZNCSock(), m_pModule(pModule) {
	if (m_pModule) m_pModule->AddSocket(this);
	EnableReadLine();
	SetMaxBufferThreshold(10240);
}
Example #6
0
CIdentAcceptedSocket::CIdentAcceptedSocket(CModule *pMod) : CSocket(pMod)
{
	EnableReadLine();
}