Ticket #7188: sftpcompression.diff
File sftpcompression.diff, 8.7 KB (added by , 11 years ago) |
---|
-
src/interface/resources/dialogs.xrc
1243 1243 <flag>wxLEFT|wxRIGHT</flag> 1244 1244 <border>14</border> 1245 1245 </object> 1246 <object class="sizeritem"> 1247 <object class="wxCheckBox" name="ID_COMPRESSION"> 1248 <label>Enable &compression</label> 1249 </object> 1250 <flag>wxTOP|wxLEFT|wxRIGHT</flag> 1251 <border>5</border> 1252 </object> 1246 1253 </object> 1247 1254 </object> 1248 1255 </object> -
src/interface/sitemanager_dialog.cpp
1411 1411 else 1412 1412 server.m_server.SetBypassProxy(false); 1413 1413 1414 if (XRCCTRL(*this, "ID_COMPRESSION", wxCheckBox)->GetValue()) 1415 server.m_server.SetCompression(true); 1416 else 1417 server.m_server.SetCompression(false); 1418 1414 1419 server.m_server.SetName(name); 1415 1420 1416 1421 return true; … … 1551 1556 XRCCTRL(*this, "ID_TRANSFERMODE_DEFAULT", wxRadioButton)->SetValue(true); 1552 1557 XRCCTRL(*this, "ID_LIMITMULTIPLE", wxCheckBox)->SetValue(false); 1553 1558 XRCCTRL(*this, "ID_MAXMULTIPLE", wxSpinCtrl)->SetValue(1); 1559 XRCCTRL(*this, "ID_COMPRESSION", wxCheckBox)->SetValue(false); 1554 1560 1555 1561 XRCCTRL(*this, "ID_CHARSET_AUTO", wxRadioButton)->SetValue(true); 1556 1562 XRCCTRL(*this, "ID_ENCODING", wxTextCtrl)->SetValue(_T("")); … … 1641 1647 XRCCTRL(*this, "ID_MAXMULTIPLE", wxSpinCtrl)->Enable(false); 1642 1648 XRCCTRL(*this, "ID_MAXMULTIPLE", wxSpinCtrl)->SetValue(1); 1643 1649 } 1650 XRCCTRL(*this, "ID_COMPRESSION", wxCheckBox)->SetValue(site_data->m_server.GetCompression()); 1644 1651 1645 1652 switch (site_data->m_server.GetEncodingType()) 1646 1653 { … … 1711 1718 void CSiteManagerDialog::OnProtocolSelChanged(wxCommandEvent& event) 1712 1719 { 1713 1720 wxChoice* pProtocol = XRCCTRL(*this, "ID_PROTOCOL", wxChoice); 1721 wxCheckBox* pCompression = XRCCTRL(*this, "ID_COMPRESSION", wxCheckBox); 1714 1722 wxChoice* pEncryption = XRCCTRL(*this, "ID_ENCRYPTION", wxChoice); 1715 1723 wxStaticText* pEncryptionDesc = XRCCTRL(*this, "ID_ENCRYPTION_DESC", wxStaticText); 1716 1724 1725 pCompression->Show(pProtocol->GetSelection() != 0); 1717 1726 pEncryption->Show(pProtocol->GetSelection() != 1); 1718 1727 pEncryptionDesc->Show(pProtocol->GetSelection() != 1); 1719 1728 } … … 2291 2300 void CSiteManagerDialog::SetProtocol(ServerProtocol protocol) 2292 2301 { 2293 2302 wxChoice* pProtocol = XRCCTRL(*this, "ID_PROTOCOL", wxChoice); 2303 wxCheckBox* pCompression = XRCCTRL(*this, "ID_COMPRESSION", wxCheckBox); 2294 2304 wxChoice* pEncryption = XRCCTRL(*this, "ID_ENCRYPTION", wxChoice); 2295 2305 wxStaticText* pEncryptionDesc = XRCCTRL(*this, "ID_ENCRYPTION_DESC", wxStaticText); 2296 2306 2297 2307 if (protocol == SFTP) 2298 2308 { 2309 pCompression->Show(); 2299 2310 pEncryption->Hide(); 2300 2311 pEncryptionDesc->Hide(); 2301 2312 pProtocol->SetSelection(1); … … 2318 2329 pEncryption->SetSelection(3); 2319 2330 break;*/ 2320 2331 } 2332 pCompression->Hide(); 2321 2333 pEncryption->Show(); 2322 2334 pEncryptionDesc->Show(); 2323 2335 pProtocol->SetSelection(0); -
src/interface/queue_storage.cpp
55 55 timezone_offset, 56 56 transfer_mode, 57 57 max_connections, 58 compression, 58 59 encoding, 59 60 bypass_proxy, 60 61 post_login_commands, … … 75 76 { _T("timezone_offset"), integer, 0 }, 76 77 { _T("transfer_mode"), text, 0 }, 77 78 { _T("max_connections"), integer, 0 }, 79 { _T("compression"), integer, 0 }, 78 80 { _T("encoding"), text, 0 }, 79 81 { _T("bypass_proxy"), integer, 0 }, 80 82 { _T("post_login_commands"), text, 0 }, … … 682 684 else 683 685 BindNull(insertServerQuery_, server_table_column_names::post_login_commands); 684 686 687 if (protocol == SFTP) 688 Bind(insertServerQuery_, server_table_column_names::compression, server.GetCompression() ? 1 : 0); 689 685 690 Bind(insertServerQuery_, server_table_column_names::bypass_proxy, server.GetBypassProxy() ? 1 : 0); 686 691 if (!server.GetName().empty()) 687 692 Bind(insertServerQuery_, server_table_column_names::name, server.GetName()); … … 948 953 return INVALID_DATA; 949 954 } 950 955 956 if (protocol == SFTP) 957 server.SetCompression(GetColumnInt(selectServersQuery_, server_table_column_names::compression) == 1 ); 951 958 952 959 server.SetBypassProxy(GetColumnInt(selectServersQuery_, server_table_column_names::bypass_proxy) == 1 ); 953 960 server.SetName( GetColumnText(selectServersQuery_, server_table_column_names::name) ); -
src/interface/xmlfunctions.cpp
652 652 return false; 653 653 } 654 654 655 if (protocol == SFTP) 656 server.SetCompression(GetTextElementInt(node, "Compression", false) == 1); 657 655 658 server.SetBypassProxy(GetTextElementInt(node, "BypassProxy", false) == 1); 656 659 server.SetName(GetTextElement_Trimmed(node, "Name")); 657 660 … … 737 740 } 738 741 } 739 742 743 if (protocol == SFTP) 744 AddTextElementRaw(node, "Compression", server.GetCompression() ? "1" : "0"); 745 740 746 AddTextElementRaw(node, "BypassProxy", server.GetBypassProxy() ? "1" : "0"); 741 747 const wxString& name = server.GetName(); 742 748 if (name != _T("")) -
src/engine/sftpcontrolsocket.cpp
433 433 executable = _T("fzsftp"); 434 434 LogMessage(Debug_Verbose, _T("Going to execute %s"), executable.c_str()); 435 435 436 m_pid = wxExecute(executable + _T(" -v"), wxEXEC_ASYNC, m_pProcess); 436 if (server.GetCompression()) 437 m_pid = wxExecute(executable + _T(" -C -v"), wxEXEC_ASYNC, m_pProcess); 438 else 439 m_pid = wxExecute(executable + _T(" -v"), wxEXEC_ASYNC, m_pProcess); 437 440 if (!m_pid) 438 441 { 439 442 LogMessage(Debug_Warning, _T("wxExecute failed")); -
src/engine/server.cpp
309 309 m_maximumMultipleConnections = op.m_maximumMultipleConnections; 310 310 m_encodingType = op.m_encodingType; 311 311 m_customEncoding = op.m_customEncoding; 312 m_compression = op.m_compression; 312 313 m_postLoginCommands = op.m_postLoginCommands; 313 314 m_bypassProxy = op.m_bypassProxy; 314 315 m_name = op.m_name; … … 357 358 if (m_customEncoding != op.m_customEncoding) 358 359 return false; 359 360 } 361 if (m_compression != op.m_compression) 362 return false; 360 363 if (m_postLoginCommands != op.m_postLoginCommands) 361 364 return false; 362 365 if (m_bypassProxy != op.m_bypassProxy) … … 441 444 else if (m_encodingType > op.m_encodingType) 442 445 return false; 443 446 447 if (m_compression < op.m_compression) 448 return true; 449 else if (m_compression > op.m_compression) 450 return false; 451 444 452 if (m_encodingType == ENCODING_CUSTOM) 445 453 { 446 454 if (m_customEncoding < op.m_customEncoding) … … 496 504 if (m_customEncoding != op.m_customEncoding) 497 505 return false; 498 506 } 507 if (m_compression != op.m_compression) 508 return false; 499 509 if (m_postLoginCommands != op.m_postLoginCommands) 500 510 return false; 501 511 if (m_bypassProxy != op.m_bypassProxy) … … 685 695 m_maximumMultipleConnections = 0; 686 696 m_encodingType = ENCODING_AUTO; 687 697 m_customEncoding = _T(""); 698 m_compression = false; 688 699 m_bypassProxy = false; 689 700 } 690 701 … … 699 710 return true; 700 711 } 701 712 713 void CServer::SetCompression(bool val) 714 { 715 m_compression = val; 716 } 717 702 718 bool CServer::SetCustomEncoding(const wxString& encoding) 703 719 { 704 720 if (encoding == _T("")) … … 715 731 return m_encodingType; 716 732 } 717 733 734 bool CServer::GetCompression() const 735 { 736 return m_compression; 737 } 738 718 739 wxString CServer::GetCustomEncoding() const 719 740 { 720 741 return m_customEncoding; -
src/include/server.h
111 111 wxString FormatServer(const bool always_include_prefix = false) const; 112 112 113 113 bool SetEncodingType(enum CharsetEncoding type, const wxString& encoding = _T("")); 114 void SetCompression(bool val); 114 115 bool SetCustomEncoding(const wxString& encoding); 115 116 enum CharsetEncoding GetEncodingType() const; 117 bool GetCompression() const; 116 118 wxString GetCustomEncoding() const; 117 119 118 120 static unsigned int GetDefaultPort(enum ServerProtocol protocol); … … 163 165 wxString m_name; 164 166 165 167 std::vector<wxString> m_postLoginCommands; 168 bool m_compression; 166 169 bool m_bypassProxy; 167 170 }; 168 171