Ticket #2161: prot_c.diff
File prot_c.diff, 4.1 KB (added by , 12 years ago) |
---|
-
src/interface/xmlfunctions.cpp
653 653 } 654 654 655 655 server.SetBypassProxy(GetTextElementInt(node, "BypassProxy", false) == 1); 656 server.SetProtLevel(GetTextElement_Trimmed(node, "ProtLevel")); 656 657 server.SetName(GetTextElement_Trimmed(node, "Name")); 657 658 658 659 if (server.GetName().empty()) … … 738 739 } 739 740 740 741 AddTextElementRaw(node, "BypassProxy", server.GetBypassProxy() ? "1" : "0"); 742 AddTextElement(node, "ProtLevel", server.GetProtLevel()); 743 741 744 const wxString& name = server.GetName(); 742 745 if (name != _T("")) 743 746 AddTextElement(node, "Name", name); -
src/include/server.h
84 84 enum PasvMode GetPasvMode() const; 85 85 int MaximumMultipleConnections() const; 86 86 bool GetBypassProxy() const; 87 wxString GetProtLevel() const; 87 88 88 89 // Return true if URL could be parsed correctly, false otherwise. 89 90 // If parsing fails, pError is filled with the reason and the CServer instance may be left an undefined state. … … 97 98 bool SetUser(const wxString& user, const wxString& pass = _T("")); 98 99 bool SetAccount(const wxString& account); 99 100 101 bool SetProtLevel(const wxString &level); 102 100 103 CServer& operator=(const CServer &op); 101 104 bool operator==(const CServer &op) const; 102 105 bool operator<(const CServer &op) const; … … 164 167 165 168 std::vector<wxString> m_postLoginCommands; 166 169 bool m_bypassProxy; 170 171 wxString m_protLevel; 167 172 }; 168 173 169 174 #endif -
src/engine/server.cpp
312 312 m_postLoginCommands = op.m_postLoginCommands; 313 313 m_bypassProxy = op.m_bypassProxy; 314 314 m_name = op.m_name; 315 m_protLevel = op.m_protLevel; 315 316 316 317 return *this; 317 318 } … … 361 362 return false; 362 363 if (m_bypassProxy != op.m_bypassProxy) 363 364 return false; 365 if (m_protLevel != op.m_protLevel) 366 return false; 364 367 365 368 // Do not compare number of allowed multiple connections 366 369 … … 453 456 else if (m_bypassProxy > op.m_bypassProxy) 454 457 return false; 455 458 459 if (m_protLevel < op.m_protLevel) 460 return true; 461 else if (m_protLevel > op.m_protLevel) 462 return false; 463 456 464 // Do not compare number of allowed multiple connections 457 465 458 466 return false; … … 500 508 return false; 501 509 if (m_bypassProxy != op.m_bypassProxy) 502 510 return false; 511 if (m_protLevel != op.m_protLevel) 512 return false; 503 513 504 514 // Do not compare number of allowed multiple connections 505 515 … … 686 696 m_encodingType = ENCODING_AUTO; 687 697 m_customEncoding = _T(""); 688 698 m_bypassProxy = false; 699 m_protLevel = _T("P"); 689 700 } 690 701 691 702 bool CServer::SetEncodingType(enum CharsetEncoding type, const wxString& encoding /*=_T("")*/) … … 823 834 return m_bypassProxy; 824 835 } 825 836 837 wxString CServer::GetProtLevel() const 838 { 839 return m_protLevel; 840 } 841 842 bool CServer::SetProtLevel(const wxString &level) 843 { 844 if (level != _T("P") && level != _T("C")) 845 return false; 846 847 m_protLevel = level; 848 return true; 849 } 850 826 851 bool CServer::ProtocolHasDataTypeConcept(const enum ServerProtocol protocol) 827 852 { 828 853 if (protocol == FTP || protocol == FTPS || protocol == FTPES) … … 881 906 return _("Anonymous"); 882 907 } 883 908 } 909 910 -
src/engine/ftpcontrolsocket.cpp
925 925 else if (pData->opState == LOGON_PROT) 926 926 { 927 927 if (code == 2 || code == 3) 928 m_protectDataChannel = true;928 m_protectDataChannel = m_pCurrentServer->GetProtLevel() != _T("C"); 929 929 } 930 930 else if (pData->opState == LOGON_CUSTOMCOMMANDS) 931 931 { … … 1191 1191 res = Send(_T("PBSZ 0")); 1192 1192 break; 1193 1193 case LOGON_PROT: 1194 res = Send(_T("PROT P"));1194 res = Send(_T("PROT ") + m_pCurrentServer->GetProtLevel()); 1195 1195 break; 1196 1196 case LOGON_CUSTOMCOMMANDS: 1197 1197 if (pData->customCommandIndex >= m_pCurrentServer->GetPostLoginCommands().size())