From 177a5d24dba2ed0343a27fa6ac3e31901df0fd73 Mon Sep 17 00:00:00 2001 From: psychon Date: Sun, 25 Jan 2009 20:07:14 +0000 Subject: [PATCH] Include Utils.h in less headers and move some code out of the header git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1350 726aef4b-f618-498e-8847-2d620e286838 --- DCCBounce.cpp | 37 +++++++++++++++++++++++++++++++++++++ DCCBounce.h | 39 ++++++--------------------------------- DCCSock.cpp | 1 + User.h | 1 - 4 files changed, 44 insertions(+), 34 deletions(-) diff --git a/DCCBounce.cpp b/DCCBounce.cpp index 423cafec..f6190e7b 100644 --- a/DCCBounce.cpp +++ b/DCCBounce.cpp @@ -15,6 +15,43 @@ const unsigned int CDCCBounce::m_uiMaxDCCBuffer = 10 * 1024; // If less than this is in the buffer, the receiving side continues const unsigned int CDCCBounce::m_uiMinDCCBuffer = 2 * 1024; +CDCCBounce::CDCCBounce(CUser* pUser, unsigned long uLongIP, unsigned short uPort, + const CString& sFileName, const CString& sRemoteNick, + const CString& sRemoteIP, CString sLocalIP, bool bIsChat) : Csock() { + m_uRemotePort = uPort; + m_sConnectIP = CUtils::GetIP(uLongIP); + m_sRemoteIP = sRemoteIP; + m_sFileName = sFileName; + m_sRemoteNick = sRemoteNick; + m_pUser = pUser; + m_bIsChat = bIsChat; + m_sLocalIP = sLocalIP; + m_pPeer = NULL; + m_bIsRemote = false; + + if (bIsChat) { + EnableReadLine(); + } +} + +CDCCBounce::CDCCBounce(const CString& sHostname, unsigned short uPort, CUser* pUser, + const CString& sRemoteNick, const CString& sRemoteIP, const CString& sFileName, + int iTimeout, bool bIsChat) : Csock(sHostname, uPort, iTimeout) { + m_uRemotePort = 0; + m_bIsChat = bIsChat; + m_pUser = pUser; + m_pPeer = NULL; + m_sRemoteNick = sRemoteNick; + m_sFileName = sFileName; + m_sRemoteIP = sRemoteIP; + m_bIsRemote = false; + + SetMaxBufferThreshold(10240); + if (bIsChat) { + EnableReadLine(); + } +} + CDCCBounce::~CDCCBounce() { if (m_pPeer) { m_pPeer->Shutdown(); diff --git a/DCCBounce.h b/DCCBounce.h index 2cb124f2..ec59e9be 100644 --- a/DCCBounce.h +++ b/DCCBounce.h @@ -10,44 +10,17 @@ #define _DCCBOUNCE_H #include "Csocket.h" -#include "Utils.h" class CUser; class CDCCBounce : public Csock { public: - CDCCBounce(CUser* pUser, unsigned long uLongIP, unsigned short uPort, const CString& sFileName, const CString& sRemoteNick, const CString& sRemoteIP, CString sLocalIP, bool bIsChat = false) : Csock() { - m_uRemotePort = uPort; - m_sConnectIP = CUtils::GetIP(uLongIP); - m_sRemoteIP = sRemoteIP; - m_sFileName = sFileName; - m_sRemoteNick = sRemoteNick; - m_pUser = pUser; - m_bIsChat = bIsChat; - m_sLocalIP = sLocalIP; - m_pPeer = NULL; - m_bIsRemote = false; - - if (bIsChat) { - EnableReadLine(); - } - } - - CDCCBounce(const CString& sHostname, unsigned short uPort, CUser* pUser, const CString& sRemoteNick, const CString& sRemoteIP, const CString& sFileName, int iTimeout = 60, bool bIsChat = false) : Csock(sHostname, uPort, iTimeout) { - m_uRemotePort = 0; - m_bIsChat = bIsChat; - m_pUser = pUser; - m_pPeer = NULL; - m_sRemoteNick = sRemoteNick; - m_sFileName = sFileName; - m_sRemoteIP = sRemoteIP; - m_bIsRemote = false; - - SetMaxBufferThreshold(10240); - if (bIsChat) { - EnableReadLine(); - } - } + CDCCBounce(CUser* pUser, unsigned long uLongIP, unsigned short uPort, + const CString& sFileName, const CString& sRemoteNick, + const CString& sRemoteIP, CString sLocalIP, bool bIsChat = false); + CDCCBounce(const CString& sHostname, unsigned short uPort, CUser* pUser, + const CString& sRemoteNick, const CString& sRemoteIP, + const CString& sFileName, int iTimeout = 60, bool bIsChat = false); virtual ~CDCCBounce(); static unsigned short DCCRequest(const CString& sNick, unsigned long uLongIP, unsigned short uPort, const CString& sFileName, bool bIsChat, CUser* pUser, const CString& sLocalIP, const CString& sRemoteIP); diff --git a/DCCSock.cpp b/DCCSock.cpp index 7ccc830d..f6d63ef1 100644 --- a/DCCSock.cpp +++ b/DCCSock.cpp @@ -8,6 +8,7 @@ #include "DCCSock.h" #include "User.h" +#include "Utils.h" CDCCSock::~CDCCSock() { if ((m_pFile) && (!m_bNoDelFile)) { diff --git a/User.h b/User.h index 37137984..a95d1a1b 100644 --- a/User.h +++ b/User.h @@ -15,7 +15,6 @@ #include "Modules.h" #endif #include "Nick.h" -#include "Utils.h" #include #include