
复制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)) returnfalse; 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)) returnfalse; 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)) returnfalse; 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 returntrue; } 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.
(责任编辑:数据库)