mirror of
https://github.com/znc/znc.git
synced 2026-08-06 00:43:19 +02:00
Add a new DCCVHost config option
If this option is set to an ip address, this one is used as the local address for DCC connections. This can e.g. be used to "fix" DCC bouncing with ipv6 connections. Without it, this just more or less fails badly. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1647 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
+6
-5
@@ -17,7 +17,7 @@ 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) : CZNCSock() {
|
||||
const CString& sRemoteIP, bool bIsChat) : CZNCSock() {
|
||||
m_uRemotePort = uPort;
|
||||
m_sConnectIP = CUtils::GetIP(uLongIP);
|
||||
m_sRemoteIP = sRemoteIP;
|
||||
@@ -25,7 +25,7 @@ CDCCBounce::CDCCBounce(CUser* pUser, unsigned long uLongIP, unsigned short uPort
|
||||
m_sRemoteNick = sRemoteNick;
|
||||
m_pUser = pUser;
|
||||
m_bIsChat = bIsChat;
|
||||
m_sLocalIP = sLocalIP;
|
||||
m_sLocalIP = pUser->GetLocalDCCIP();
|
||||
m_pPeer = NULL;
|
||||
m_bIsRemote = false;
|
||||
|
||||
@@ -205,9 +205,10 @@ void CDCCBounce::PutPeer(const CString& sLine) {
|
||||
}
|
||||
}
|
||||
|
||||
unsigned short CDCCBounce::DCCRequest(const CString& sNick, unsigned long uLongIP, unsigned short uPort, const CString& sFileName, bool bIsChat, CUser* pUser, const CString& sLocalIP, const CString& sRemoteIP) {
|
||||
CDCCBounce* pDCCBounce = new CDCCBounce(pUser, uLongIP, uPort, sFileName, sNick, sRemoteIP, sLocalIP, bIsChat);
|
||||
unsigned short uListenPort = CZNC::Get().GetManager().ListenRand("DCC::" + CString((bIsChat) ? "Chat" : "Xfer") + "::Local::" + sNick, sLocalIP, false, SOMAXCONN, pDCCBounce, 120);
|
||||
unsigned short CDCCBounce::DCCRequest(const CString& sNick, unsigned long uLongIP, unsigned short uPort, const CString& sFileName, bool bIsChat, CUser* pUser, const CString& sRemoteIP) {
|
||||
CDCCBounce* pDCCBounce = new CDCCBounce(pUser, uLongIP, uPort, sFileName, sNick, sRemoteIP, bIsChat);
|
||||
unsigned short uListenPort = CZNC::Get().GetManager().ListenRand("DCC::" + CString((bIsChat) ? "Chat" : "Xfer") + "::Local::" + sNick,
|
||||
pUser->GetLocalDCCIP(), false, SOMAXCONN, pDCCBounce, 120);
|
||||
|
||||
return uListenPort;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user