FileZilla FTP 兼容FtpAnywhere

复制 bool CFtpControlSocket::ParsePasvResponse(CRawTransferOpData* pData) { // Validate ip address wxString digit = _T("0*[0-9]{1,兼容3}"); const wxChar* dot = _T(","); wxString exp = _T("( |\\()(") + digit + dot + digit + dot + digit + dot + digit + dot + digit + dot + digit + _T(")( |\\)|$)"); wxRegEx regex; regex.Compile(exp); if (!regex.Matches(m_Response)) return false; pData->host = regex.GetMatch(m_Response, 2); int i = pData->host.Find(,, true); long number; if (i == -1 || !pData->host.Mid(i + 1).ToLong(&number)) return false; pData->port = number; //get ls byte of server socket pData->host = pData->host.Left(i); i = pData->host.Find(,, true); if (i == -1 || !pData->host.Mid(i + 1).ToLong(&number)) return false; pData->port += 256 * number; //add ms byte of server socket pData->host = pData-> host.Left(i); pData->host.Replace(_T(","), _T(".")); if (m_pProxyBackend) { // We do not have any information about the proxys inner workings return true; } const wxString peerIP = m_pSocket->GetPeerIP(); if (!IsRoutableAddress(pData->host, m_pSocket->GetAddressFamily()) && IsRoutableAddress(peerIP, m_pSocket->GetAddressFamily())) { if (!m_pEngine->GetOptions()->GetOptionVal(OPTION_PASVREPLYFALLBACKMODE) || pData->bTriedActive) { LogMessage(Status, _("Server sent passive reply with unroutable address. Using server address instead.")); LogMessage(Debug_Info, _T(" Reply: %s, peer: %s"), pData->host.c_str(), peerIP.c_str()); pData->host = peerIP; } else { LogMessage(Status, _("Server sent passive reply with unroutable address. Passive mode failed.")); LogMessage(Debug_Info, _T(" Reply: %s, peer: %s"), pData->host.c_str(), peerIP.c_str()); return false; } } return true; } 1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.25.26.27.28.29.30.31.32.33.34.35.36.37.38.39.40.41.42.43.44.45.46.47.48.49.50.51.52.53.54.55.56.57.58.59.60.61.62.63.64.65.66.67.68.69.70.71.72.73.74.75.76.77.78.79.80.81.82.83.84.85.86.87.88.89.90.91.92.
本文地址:http://www.bzuk.cn/news/061f8099858.html
版权声明
本文仅代表作者观点,不代表本站立场。
本文系作者授权发表,未经许可,不得转载。