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:
psychon
2009-10-10 12:45:25 +00:00
parent 94667c1e90
commit cda8e7c0ba
7 changed files with 38 additions and 18 deletions
+3 -3
View File
@@ -395,7 +395,7 @@ void CClient::ReadLine(const CString& sData) {
unsigned long uLongIP = sCTCP.Token(3).ToULong();
unsigned short uPort = sCTCP.Token(4).ToUShort();
unsigned long uFileSize = sCTCP.Token(5).ToULong();
CString sIP = (m_pIRCSock) ? m_pIRCSock->GetLocalIP() : GetLocalIP();
CString sIP = m_pUser->GetLocalDCCIP();
if (!m_pUser->UseClientIP()) {
uLongIP = CUtils::GetLongIP(GetRemoteIP());
@@ -403,7 +403,7 @@ void CClient::ReadLine(const CString& sData) {
if (sType.Equals("CHAT")) {
if (!sTarget.TrimPrefix(m_pUser->GetStatusPrefix())) {
unsigned short uBNCPort = CDCCBounce::DCCRequest(sTarget, uLongIP, uPort, "", true, m_pUser, (m_pIRCSock) ? m_pIRCSock->GetLocalIP() : GetLocalIP(), "");
unsigned short uBNCPort = CDCCBounce::DCCRequest(sTarget, uLongIP, uPort, "", true, m_pUser, "");
if (uBNCPort) {
PutIRC("PRIVMSG " + sTarget + " :\001DCC CHAT chat " + CString(CUtils::GetLongIP(sIP)) + " " + CString(uBNCPort) + "\001");
}
@@ -434,7 +434,7 @@ void CClient::ReadLine(const CString& sData) {
MODULECALL(OnDCCUserSend(CString(m_pUser->GetStatusPrefix() + sTarget), uLongIP, uPort, sFile, uFileSize), m_pUser, this, return);
}
} else {
unsigned short uBNCPort = CDCCBounce::DCCRequest(sTarget, uLongIP, uPort, sFile, false, m_pUser, (m_pIRCSock) ? m_pIRCSock->GetLocalIP() : GetLocalIP(), "");
unsigned short uBNCPort = CDCCBounce::DCCRequest(sTarget, uLongIP, uPort, sFile, false, m_pUser, "");
if (uBNCPort) {
PutIRC("PRIVMSG " + sTarget + " :\001DCC SEND " + sFile + " " + CString(CUtils::GetLongIP(sIP)) + " " + CString(uBNCPort) + " " + CString(uFileSize) + "\001");
}