Ticket #8976: filezilla_3.7.3_proxy_per_site.patch
File filezilla_3.7.3_proxy_per_site.patch, 29.9 KB (added by , 11 years ago) |
---|
-
src/engine/ControlSocket.cpp
diff --strip-trailing-cr -Nur filezilla-3.7.3.orig/src/engine/ControlSocket.cpp filezilla-3.7.3/src/engine/ControlSocket.cpp
old new 1163 1163 wxString host; 1164 1164 unsigned int port = 0; 1165 1165 1166 const int proxy_type = m_pEngine->GetOptions()->GetOptionVal(OPTION_PROXY_TYPE); 1167 if (proxy_type > CProxySocket::unknown && proxy_type < CProxySocket::proxytype_count && !m_pCurrentServer->GetBypassProxy()) 1166 int proxyType = 0; 1167 wxString proxyHost; 1168 unsigned int proxyPort; 1169 wxString proxyUser; 1170 wxString proxyPass; 1171 1172 if (m_pCurrentServer->GetProxyType() > CProxySocket::unknown && 1173 m_pCurrentServer->GetProxyType() < CProxySocket::proxytype_count 1174 && m_pCurrentServer->GetProxyHost() != _T("")) 1175 { 1176 proxyType = m_pCurrentServer->GetProxyType(); 1177 proxyHost = m_pCurrentServer->GetProxyHost(); 1178 proxyPort = m_pCurrentServer->GetProxyPort(); 1179 proxyUser = m_pCurrentServer->GetProxyUser(); 1180 proxyPass = m_pCurrentServer->GetProxyPass(); 1181 } 1182 else if (!m_pCurrentServer->GetBypassProxy()) 1183 { 1184 proxyType = m_pEngine->GetOptions()->GetOptionVal(OPTION_PROXY_TYPE); 1185 proxyHost = m_pEngine->GetOptions()->GetOption(OPTION_PROXY_HOST); 1186 proxyPort = m_pEngine->GetOptions()->GetOptionVal(OPTION_PROXY_PORT); 1187 proxyUser = m_pEngine->GetOptions()->GetOption(OPTION_PROXY_USER); 1188 proxyPass = m_pEngine->GetOptions()->GetOption(OPTION_PROXY_PASS); 1189 } 1190 if (proxyType > CProxySocket::unknown && proxyType < CProxySocket::proxytype_count) 1168 1191 { 1169 1192 LogMessage(::Status, _("Connecting to %s through proxy"), m_pCurrentServer->FormatHost().c_str()); 1170 1193 1171 host = m_pEngine->GetOptions()->GetOption(OPTION_PROXY_HOST);1172 port = m_pEngine->GetOptions()->GetOptionVal(OPTION_PROXY_PORT);1194 host = proxyHost; 1195 port = proxyPort; 1173 1196 1174 1197 delete m_pBackend; 1175 1198 m_pProxyBackend = new CProxySocket(this, m_pSocket, this); 1176 1199 m_pBackend = m_pProxyBackend; 1177 int res = m_pProxyBackend->Handshake((enum CProxySocket::ProxyType)proxy _type,1200 int res = m_pProxyBackend->Handshake((enum CProxySocket::ProxyType)proxyType, 1178 1201 m_pCurrentServer->GetHost(), m_pCurrentServer->GetPort(), 1179 m_pEngine->GetOptions()->GetOption(OPTION_PROXY_USER),1180 m_pEngine->GetOptions()->GetOption(OPTION_PROXY_PASS));1202 proxyUser, 1203 proxyPass); 1181 1204 1182 1205 if (res != EINPROGRESS) 1183 1206 { … … 1485 1508 int CControlSocket::Chmod(const CChmodCommand&) 1486 1509 { 1487 1510 return FZ_REPLY_NOTSUPPORTED; 1488 } 1489 No newline at end of file 1511 } -
src/engine/ftpcontrolsocket.cpp
diff --strip-trailing-cr -Nur filezilla-3.7.3.orig/src/engine/ftpcontrolsocket.cpp filezilla-3.7.3/src/engine/ftpcontrolsocket.cpp
old new 4395 4395 4396 4396 // Do not use FTP proxy if generic proxy is set 4397 4397 int generic_proxy_type = m_pEngine->GetOptions()->GetOptionVal(OPTION_PROXY_TYPE); 4398 if ((generic_proxy_type <= CProxySocket::unknown || generic_proxy_type >= CProxySocket::proxytype_count) && 4398 if ((server.GetProxyType() <= CProxySocket::unknown || server.GetProxyType() >= CProxySocket::proxytype_count || server.GetProxyHost() == _T("")) && 4399 (generic_proxy_type <= CProxySocket::unknown || generic_proxy_type >= CProxySocket::proxytype_count) && 4399 4400 (pData->ftp_proxy_type = m_pEngine->GetOptions()->GetOptionVal(OPTION_FTP_PROXY_TYPE)) && !server.GetBypassProxy()) 4400 4401 { 4401 4402 pData->host = m_pEngine->GetOptions()->GetOption(OPTION_FTP_PROXY_HOST); -
src/engine/server.cpp
diff --strip-trailing-cr -Nur filezilla-3.7.3.orig/src/engine/server.cpp filezilla-3.7.3/src/engine/server.cpp
old new 307 307 m_timezoneOffset = op.m_timezoneOffset; 308 308 m_pasvMode = op.m_pasvMode; 309 309 m_maximumMultipleConnections = op.m_maximumMultipleConnections; 310 m_proxyType = op.m_proxyType; 311 m_proxyHost = op.m_proxyHost; 312 m_proxyPort = op.m_proxyPort; 313 m_proxyUser = op.m_proxyUser; 314 m_proxyPass = op.m_proxyPass; 310 315 m_encodingType = op.m_encodingType; 311 316 m_customEncoding = op.m_customEncoding; 312 317 m_postLoginCommands = op.m_postLoginCommands; … … 350 355 return false; 351 356 else if (m_pasvMode != op.m_pasvMode) 352 357 return false; 358 else if (m_proxyType != op.m_proxyType) 359 return false; 360 else if (m_proxyHost != op.m_proxyHost) 361 return false; 362 else if (m_proxyPort != op.m_proxyPort) 363 return false; 364 else if (m_proxyUser != op.m_proxyUser) 365 return false; 366 else if (m_proxyPass != op.m_proxyPass) 367 return false; 353 368 else if (m_encodingType != op.m_encodingType) 354 369 return false; 355 370 else if (m_encodingType == ENCODING_CUSTOM) … … 436 451 else if (m_pasvMode > op.m_pasvMode) 437 452 return false; 438 453 454 if (m_proxyType < op.m_proxyType) 455 return true; 456 else if (m_proxyType > op.m_proxyType) 457 return false; 458 if (m_proxyHost < op.m_proxyHost) 459 return true; 460 else if (m_proxyHost > op.m_proxyHost) 461 return false; 462 if (m_proxyPort < op.m_proxyPort) 463 return true; 464 else if (m_proxyPort > op.m_proxyPort) 465 return false; 466 if (m_proxyUser < op.m_proxyUser) 467 return true; 468 else if (m_proxyUser > op.m_proxyUser) 469 return false; 470 if (m_proxyPass < op.m_proxyPass) 471 return true; 472 else if (m_proxyPass > op.m_proxyPass) 473 return false; 474 439 475 if (m_encodingType < op.m_encodingType) 440 476 return true; 441 477 else if (m_encodingType > op.m_encodingType) … … 489 525 return false; 490 526 else if (m_pasvMode != op.m_pasvMode) 491 527 return false; 528 else if (m_proxyType != op.m_proxyType) 529 return false; 530 else if (m_proxyHost != op.m_proxyHost) 531 return false; 532 else if (m_proxyPort != op.m_proxyPort) 533 return false; 534 else if (m_proxyUser != op.m_proxyUser) 535 return false; 536 else if (m_proxyPass != op.m_proxyPass) 537 return false; 492 538 else if (m_encodingType != op.m_encodingType) 493 539 return false; 494 540 else if (m_encodingType == ENCODING_CUSTOM) … … 635 681 return m_maximumMultipleConnections; 636 682 } 637 683 684 int CServer::GetProxyType() const 685 { 686 return m_proxyType; 687 } 688 689 void CServer::SetProxyType(int type) 690 { 691 m_proxyType = type; 692 } 693 694 wxString CServer::GetProxyHost() const 695 { 696 return m_proxyHost; 697 } 698 699 bool CServer::SetProxyHost(wxString host) 700 { 701 m_proxyHost = host; 702 return true; 703 } 704 705 unsigned int CServer::GetProxyPort() const 706 { 707 return m_proxyPort; 708 } 709 710 bool CServer::SetProxyPort(unsigned int port) 711 { 712 if (port < 1 || port > 65535) 713 return false; 714 m_proxyPort = port; 715 return true; 716 } 717 718 wxString CServer::GetProxyUser() const 719 { 720 return m_proxyUser; 721 } 722 723 bool CServer::SetProxyUser(wxString user) 724 { 725 m_proxyUser = user; 726 return true; 727 } 728 729 wxString CServer::GetProxyPass() const 730 { 731 return m_proxyPass; 732 } 733 734 bool CServer::SetProxyPass(wxString pass) 735 { 736 m_proxyPass = pass; 737 return true; 738 } 739 638 740 wxString CServer::FormatHost(bool always_omit_port /*=false*/) const 639 741 { 640 742 wxString host = m_host; … … 683 785 m_timezoneOffset = 0; 684 786 m_pasvMode = MODE_DEFAULT; 685 787 m_maximumMultipleConnections = 0; 788 m_proxyType = 0; 789 m_proxyUser = _T(""); 790 m_proxyPort = 8080; 791 m_proxyUser = _T(""); 792 m_proxyPass = _T(""); 686 793 m_encodingType = ENCODING_AUTO; 687 794 m_customEncoding = _T(""); 688 795 m_bypassProxy = false; -
src/engine/sftpcontrolsocket.cpp
diff --strip-trailing-cr -Nur filezilla-3.7.3.orig/src/engine/sftpcontrolsocket.cpp filezilla-3.7.3/src/engine/sftpcontrolsocket.cpp
old new 486 486 switch (pData->opState) 487 487 { 488 488 case connect_init: 489 if (m_pEngine->GetOptions()->GetOptionVal(OPTION_PROXY_TYPE) && !m_pCurrentServer->GetBypassProxy()) 489 if ((m_pCurrentServer->GetProxyType() && m_pCurrentServer->GetProxyHost() != _T("")) || 490 (m_pEngine->GetOptions()->GetOptionVal(OPTION_PROXY_TYPE) && !m_pCurrentServer->GetBypassProxy())) 490 491 pData->opState = connect_proxy; 491 492 else if (pData->pKeyFiles) 492 493 pData->opState = connect_keys; … … 540 541 { 541 542 case connect_proxy: 542 543 { 543 int type; 544 switch (m_pEngine->GetOptions()->GetOptionVal(OPTION_PROXY_TYPE)) 545 { 546 case CProxySocket::HTTP: 547 type = 1; 548 break; 549 case CProxySocket::SOCKS5: 550 type = 2; 551 break; 552 default: 553 LogMessage(__TFILE__, __LINE__, this, Debug_Warning, _T("Unsupported proxy type")); 554 DoClose(FZ_REPLY_INTERNALERROR); 555 return FZ_REPLY_ERROR; 556 } 557 558 wxString cmd = wxString::Format(_T("proxy %d \"%s\" %d"), type, 559 m_pEngine->GetOptions()->GetOption(OPTION_PROXY_HOST).c_str(), 560 m_pEngine->GetOptions()->GetOptionVal(OPTION_PROXY_PORT)); 561 wxString user = m_pEngine->GetOptions()->GetOption(OPTION_PROXY_USER); 562 if (user != _T("")) 563 cmd += _T(" \"") + user + _T("\""); 564 565 wxString show = cmd; 566 567 wxString pass = m_pEngine->GetOptions()->GetOption(OPTION_PROXY_PASS); 568 if (pass != _T("")) 569 { 570 cmd += _T(" \"") + pass + _T("\""); 571 show += _T(" \"") + wxString('*', pass.Len()) + _T("\""); 572 } 573 res = Send(cmd, show); 544 int proxyType; 545 wxString proxyHost; 546 unsigned int proxyPort; 547 wxString proxyUser; 548 wxString proxyPass; 549 550 if (m_pCurrentServer->GetProxyType() && m_pCurrentServer->GetProxyHost() != _T("")) 551 { 552 proxyType = m_pCurrentServer->GetProxyType(); 553 proxyHost = m_pCurrentServer->GetProxyHost(); 554 proxyPort = m_pCurrentServer->GetProxyPort(); 555 proxyUser = m_pCurrentServer->GetProxyUser(); 556 proxyPass = m_pCurrentServer->GetProxyPass(); 557 } 558 else { 559 proxyType = m_pEngine->GetOptions()->GetOptionVal(OPTION_PROXY_TYPE); 560 proxyHost = m_pEngine->GetOptions()->GetOption(OPTION_PROXY_HOST); 561 proxyPort = m_pEngine->GetOptions()->GetOptionVal(OPTION_PROXY_PORT); 562 proxyUser = m_pEngine->GetOptions()->GetOption(OPTION_PROXY_USER); 563 proxyPass = m_pEngine->GetOptions()->GetOption(OPTION_PROXY_PASS); 564 } 565 566 int type; 567 switch (proxyType) 568 { 569 case CProxySocket::HTTP: 570 type = 1; 571 break; 572 case CProxySocket::SOCKS5: 573 type = 2; 574 break; 575 default: 576 LogMessage(__TFILE__, __LINE__, this, Debug_Warning, _T("Unsupported proxy type")); 577 DoClose(FZ_REPLY_INTERNALERROR); 578 return FZ_REPLY_ERROR; 579 } 580 581 wxString cmd = wxString::Format(_T("proxy %d \"%s\" %d"), type, 582 proxyHost.c_str(), 583 proxyPort); 584 wxString user = proxyUser; 585 if (user != _T("")) 586 cmd += _T(" \"") + user + _T("\""); 587 588 wxString show = cmd; 589 590 wxString pass = proxyPass; 591 if (pass != _T("")) 592 { 593 cmd += _T(" \"") + pass + _T("\""); 594 show += _T(" \"") + wxString('*', pass.Len()) + _T("\""); 595 } 596 res = Send(cmd, show); 574 597 } 575 598 break; 576 599 case connect_keys: -
src/include/server.h
diff --strip-trailing-cr -Nur filezilla-3.7.3.orig/src/include/server.h filezilla-3.7.3/src/include/server.h
old new 107 107 void SetPasvMode(enum PasvMode pasvMode); 108 108 void MaximumMultipleConnections(int maximum); 109 109 110 int GetProxyType() const; 111 void SetProxyType(int type); 112 wxString GetProxyHost() const; 113 bool SetProxyHost(wxString host); 114 unsigned int GetProxyPort() const; 115 bool SetProxyPort(unsigned int port); 116 wxString GetProxyUser() const; 117 bool SetProxyUser(wxString user); 118 wxString GetProxyPass() const; 119 bool SetProxyPass(wxString pass); 120 110 121 wxString FormatHost(bool always_omit_port = false) const; 111 122 wxString FormatServer(const bool always_include_prefix = false) const; 112 123 … … 158 169 int m_timezoneOffset; 159 170 enum PasvMode m_pasvMode; 160 171 int m_maximumMultipleConnections; 172 int m_proxyType; 173 wxString m_proxyHost; 174 unsigned int m_proxyPort; 175 wxString m_proxyUser; 176 wxString m_proxyPass; 161 177 enum CharsetEncoding m_encodingType; 162 178 wxString m_customEncoding; 163 179 wxString m_name; -
src/interface/queue_storage.cpp
diff --strip-trailing-cr -Nur filezilla-3.7.3.orig/src/interface/queue_storage.cpp filezilla-3.7.3/src/interface/queue_storage.cpp
old new 58 58 encoding, 59 59 bypass_proxy, 60 60 post_login_commands, 61 name 61 name, 62 proxy_type, 63 proxy_host, 64 proxy_port, 65 proxy_user, 66 proxy_pass 62 67 }; 63 68 } 64 69 … … 78 83 { _T("encoding"), text, 0 }, 79 84 { _T("bypass_proxy"), integer, 0 }, 80 85 { _T("post_login_commands"), text, 0 }, 81 { _T("name"), text, 0 } 86 { _T("name"), text, 0 }, 87 { _T("proxy_type"), integer, 0 }, 88 { _T("proxy_host"), text, 0 }, 89 { _T("proxy_port"), integer, 0 }, 90 { _T("proxy_user"), text, 0 }, 91 { _T("proxy_pass"), text, 0 } 82 92 }; 83 93 84 94 namespace file_table_column_names … … 647 657 } 648 658 Bind(insertServerQuery_, server_table_column_names::max_connections, server.MaximumMultipleConnections()); 649 659 660 Bind(insertServerQuery_, server_table_column_names::proxy_type, static_cast<int>(server.GetProxyType())); 661 Bind(insertServerQuery_, server_table_column_names::proxy_host, server.GetProxyHost()); 662 Bind(insertServerQuery_, server_table_column_names::proxy_port, static_cast<int>(server.GetProxyPort())); 663 Bind(insertServerQuery_, server_table_column_names::proxy_user, server.GetProxyUser()); 664 Bind(insertServerQuery_, server_table_column_names::proxy_pass, server.GetProxyPass()); 665 650 666 switch (server.GetEncodingType()) 651 667 { 652 668 default: … … 912 928 return INVALID_DATA; 913 929 server.MaximumMultipleConnections(maximumMultipleConnections); 914 930 931 int proxyType = GetColumnInt(selectServersQuery_, server_table_column_names::proxy_type); 932 server.SetProxyType(proxyType); 933 wxString proxyHost = GetColumnText(selectServersQuery_, server_table_column_names::proxy_host); 934 if (!server.SetProxyHost(proxyHost)) 935 return INVALID_DATA; 936 int proxyPort = GetColumnInt(selectServersQuery_, server_table_column_names::proxy_port); 937 if (!server.SetProxyPort(proxyPort)) 938 return INVALID_DATA; 939 wxString proxyUser = GetColumnText(selectServersQuery_, server_table_column_names::proxy_user); 940 if (!server.SetProxyUser(proxyUser)) 941 return INVALID_DATA; 942 wxString proxyPass = GetColumnText(selectServersQuery_, server_table_column_names::proxy_pass); 943 if (!server.SetProxyPass(proxyPass)) 944 return INVALID_DATA; 945 915 946 wxString encodingType = GetColumnText(selectServersQuery_, server_table_column_names::encoding); 916 947 if (encodingType.empty() || encodingType == _T("Auto")) 917 948 server.SetEncodingType(ENCODING_AUTO); -
src/interface/resources/dialogs.xrc
diff --strip-trailing-cr -Nur filezilla-3.7.3.orig/src/interface/resources/dialogs.xrc filezilla-3.7.3/src/interface/resources/dialogs.xrc
old new 961 961 <cellpos>3,0</cellpos> 962 962 <cellspan>0,2</cellspan> 963 963 </object> 964 964 965 965 <object class="sizeritem"> 966 966 <object class="wxStaticText"> 967 967 <label>&Logon Type:</label> … … 1245 1245 </object> 1246 1246 </object> 1247 1247 </object> 1248 </object> 1249 <object class="notebookpage"> 1250 <label>Generic proxy</label> 1251 <object class="wxPanel"> 1252 <object class="wxBoxSizer"> 1253 <orient>wxVERTICAL</orient> 1254 <object class="sizeritem"> 1255 <object class="wxStaticBoxSizer"> 1256 <label>Generic proxy</label> 1257 <orient>wxHORIZONTAL</orient> 1258 <object class="sizeritem"> 1259 <object class="wxFlexGridSizer"> 1260 <cols>1</cols> 1261 <vgap>5</vgap> 1262 <object class="sizeritem"> 1263 <object class="wxStaticText"> 1264 <label>Type of generic proxy:</label> 1265 </object> 1266 </object> 1267 <object class="sizeritem"> 1268 <object class="wxRadioButton" name="ID_PROXYTYPE_NONE"> 1269 <label>&None</label> 1270 </object> 1271 </object> 1272 <object class="sizeritem"> 1273 <object class="wxRadioButton" name="ID_PROXYTYPE_HTTP"> 1274 <label>&HTTP/1.1 using CONNECT method</label> 1275 </object> 1276 </object> 1277 <object class="sizeritem"> 1278 <object class="wxRadioButton" name="ID_PROXYTYPE_SOCKS5"> 1279 <label>&SOCKS 5</label> 1280 </object> 1281 </object> 1282 <object class="sizeritem"> 1283 <object class="wxFlexGridSizer"> 1284 <cols>2</cols> 1285 <object class="sizeritem"> 1286 <object class="wxStaticText"> 1287 <label>P&roxy host:</label> 1288 </object> 1289 <flag>wxALIGN_CENTRE_VERTICAL</flag> 1290 </object> 1291 <object class="sizeritem"> 1292 <object class="wxTextCtrl" name="ID_PROXY_HOST"/> 1293 <flag>wxALIGN_CENTRE_VERTICAL|wxGROW</flag> 1294 </object> 1295 <object class="sizeritem"> 1296 <object class="wxStaticText"> 1297 <label>Proxy &port:</label> 1298 </object> 1299 <flag>wxALIGN_CENTRE_VERTICAL</flag> 1300 </object> 1301 <object class="sizeritem"> 1302 <object class="wxTextCtrl" name="ID_PROXY_PORT"> 1303 <size>50,-1</size> 1304 </object> 1305 <flag>wxALIGN_CENTRE_VERTICAL</flag> 1306 </object> 1307 <object class="sizeritem"> 1308 <object class="wxStaticText"> 1309 <label>Proxy &user:</label> 1310 </object> 1311 <flag>wxALIGN_CENTRE_VERTICAL</flag> 1312 </object> 1313 <object class="sizeritem"> 1314 <object class="wxTextCtrl" name="ID_PROXY_USER"/> 1315 <flag>wxALIGN_CENTRE_VERTICAL|wxGROW</flag> 1316 </object> 1317 <object class="sizeritem"> 1318 <object class="wxStaticText"> 1319 <label>Pro&xy password:</label> 1320 </object> 1321 <flag>wxALIGN_CENTRE_VERTICAL</flag> 1322 </object> 1323 <object class="sizeritem"> 1324 <object class="wxTextCtrl" name="ID_PROXY_PASS"> 1325 <style>wxTE_PASSWORD</style> 1326 </object> 1327 <flag>wxALIGN_CENTRE_VERTICAL|wxGROW</flag> 1328 </object> 1329 <vgap>5</vgap> 1330 <hgap>5</hgap> 1331 <growablecols>1</growablecols> 1332 </object> 1333 <flag>wxGROW</flag> 1334 </object> 1335 <growablecols>0</growablecols> 1336 <object class="sizeritem"> 1337 <object class="wxStaticText"> 1338 <label>Note: Using a generic proxy forces passive mode on FTP connections.</label> 1339 </object> 1340 </object> 1341 </object> 1342 <option>1</option> 1343 <flag>wxBOTTOM|wxLEFT|wxRIGHT|wxGROW</flag> 1344 <border>5</border> 1345 </object> 1346 </object> 1347 <option>1</option> 1348 <flag>wxGROW</flag> 1349 </object> 1350 </object> 1351 </object> 1248 1352 </object> 1249 1353 <object class="notebookpage"> 1250 1354 <label>Charset</label> -
src/interface/sitemanager_dialog.cpp
diff --strip-trailing-cr -Nur filezilla-3.7.3.orig/src/interface/sitemanager_dialog.cpp filezilla-3.7.3/src/interface/sitemanager_dialog.cpp
old new 32 32 EVT_BUTTON(XRCID("ID_BROWSE"), CSiteManagerDialog::OnRemoteDirBrowse) 33 33 EVT_TREE_ITEM_ACTIVATED(XRCID("ID_SITETREE"), CSiteManagerDialog::OnItemActivated) 34 34 EVT_CHECKBOX(XRCID("ID_LIMITMULTIPLE"), CSiteManagerDialog::OnLimitMultipleConnectionsChanged) 35 EVT_RADIOBUTTON(XRCID("ID_PROXYTYPE_NONE"), CSiteManagerDialog::OnProxyChange) 36 EVT_RADIOBUTTON(XRCID("ID_PROXYTYPE_HTTP"), CSiteManagerDialog::OnProxyChange) 37 EVT_RADIOBUTTON(XRCID("ID_PROXYTYPE_SOCKS5"), CSiteManagerDialog::OnProxyChange) 35 38 EVT_RADIOBUTTON(XRCID("ID_CHARSET_AUTO"), CSiteManagerDialog::OnCharsetChange) 36 39 EVT_RADIOBUTTON(XRCID("ID_CHARSET_UTF8"), CSiteManagerDialog::OnCharsetChange) 37 40 EVT_RADIOBUTTON(XRCID("ID_CHARSET_CUSTOM"), CSiteManagerDialog::OnCharsetChange) … … 403 406 XRCCTRL(*this, "ID_TRANSFERMODE_ACTIVE", wxRadioButton)->Update(); 404 407 XRCCTRL(*this, "ID_TRANSFERMODE_PASSIVE", wxRadioButton)->Update(); 405 408 409 XRCCTRL(*this, "ID_PROXYTYPE_NONE", wxRadioButton)->Update(); 410 XRCCTRL(*this, "ID_PROXYTYPE_HTTP", wxRadioButton)->Update(); 411 XRCCTRL(*this, "ID_PROXYTYPE_SOCKS5", wxRadioButton)->Update(); 412 406 413 wxTreeItemId item = pTree->GetSelection(); 407 414 if (!item.IsOk()) 408 415 pTree->SelectItem(m_ownSites); … … 1396 1403 else 1397 1404 server.m_server.MaximumMultipleConnections(0); 1398 1405 1406 if (XRCCTRL(*this, "ID_PROXYTYPE_HTTP", wxRadioButton)->GetValue()) 1407 server.m_server.SetProxyType(1); 1408 else if (XRCCTRL(*this, "ID_PROXYTYPE_SOCKS5", wxRadioButton)->GetValue()) 1409 server.m_server.SetProxyType(2); 1410 else 1411 server.m_server.SetProxyType(0); 1412 server.m_server.SetProxyHost(XRCCTRL(*this, "ID_PROXY_HOST", wxTextCtrl)->GetValue()); 1413 unsigned long proxyPort; 1414 XRCCTRL(*this, "ID_PROXY_PORT", wxTextCtrl)->GetValue().ToULong(&proxyPort); 1415 server.m_server.SetProxyPort(proxyPort); 1416 server.m_server.SetProxyUser(XRCCTRL(*this, "ID_PROXY_USER", wxTextCtrl)->GetValue()); 1417 server.m_server.SetProxyPass(XRCCTRL(*this, "ID_PROXY_PASS", wxTextCtrl)->GetValue()); 1418 1399 1419 if (XRCCTRL(*this, "ID_CHARSET_UTF8", wxRadioButton)->GetValue()) 1400 1420 server.m_server.SetEncodingType(ENCODING_UTF8); 1401 1421 else if (XRCCTRL(*this, "ID_CHARSET_CUSTOM", wxRadioButton)->GetValue()) … … 1642 1662 XRCCTRL(*this, "ID_MAXMULTIPLE", wxSpinCtrl)->SetValue(1); 1643 1663 } 1644 1664 1665 int type = site_data->m_server.GetProxyType(); 1666 if (type == 1) 1667 { 1668 XRCCTRL(*this, "ID_PROXYTYPE_HTTP", wxRadioButton)->SetValue(true); 1669 XRCCTRL(*this, "ID_BYPASSPROXY", wxCheckBox)->Enable(false); 1670 XRCCTRL(*this, "ID_PROXY_HOST", wxTextCtrl)->Enable(true); 1671 XRCCTRL(*this, "ID_PROXY_PORT", wxTextCtrl)->Enable(true); 1672 XRCCTRL(*this, "ID_PROXY_USER", wxTextCtrl)->Enable(true); 1673 XRCCTRL(*this, "ID_PROXY_PASS", wxTextCtrl)->Enable(true); 1674 } 1675 else if (type == 2) 1676 { 1677 XRCCTRL(*this, "ID_PROXYTYPE_SOCKS5", wxRadioButton)->SetValue(true); 1678 XRCCTRL(*this, "ID_BYPASSPROXY", wxCheckBox)->Enable(false); 1679 XRCCTRL(*this, "ID_PROXY_HOST", wxTextCtrl)->Enable(true); 1680 XRCCTRL(*this, "ID_PROXY_PORT", wxTextCtrl)->Enable(true); 1681 XRCCTRL(*this, "ID_PROXY_USER", wxTextCtrl)->Enable(true); 1682 XRCCTRL(*this, "ID_PROXY_PASS", wxTextCtrl)->Enable(true); 1683 } 1684 else 1685 { 1686 XRCCTRL(*this, "ID_PROXYTYPE_NONE", wxRadioButton)->SetValue(true); 1687 XRCCTRL(*this, "ID_BYPASSPROXY", wxCheckBox)->Enable(true); 1688 XRCCTRL(*this, "ID_PROXY_HOST", wxTextCtrl)->Enable(false); 1689 XRCCTRL(*this, "ID_PROXY_PORT", wxTextCtrl)->Enable(false); 1690 XRCCTRL(*this, "ID_PROXY_USER", wxTextCtrl)->Enable(false); 1691 XRCCTRL(*this, "ID_PROXY_PASS", wxTextCtrl)->Enable(false); 1692 } 1693 XRCCTRL(*this, "ID_PROXYTYPE_HTTP", wxWindow)->Enable(!predefined); 1694 XRCCTRL(*this, "ID_PROXYTYPE_SOCKS5", wxWindow)->Enable(!predefined); 1695 XRCCTRL(*this, "ID_PROXYTYPE_NONE", wxWindow)->Enable(!predefined); 1696 XRCCTRL(*this, "ID_PROXY_HOST", wxTextCtrl)->SetValue(site_data->m_server.GetProxyHost()); 1697 unsigned int proxyPort = site_data->m_server.GetProxyPort(); 1698 XRCCTRL(*this, "ID_PROXY_PORT", wxTextCtrl)->SetValue(wxString::Format(_T("%d"), proxyPort)); 1699 XRCCTRL(*this, "ID_PROXY_USER", wxTextCtrl)->SetValue(site_data->m_server.GetProxyUser()); 1700 XRCCTRL(*this, "ID_PROXY_PASS", wxTextCtrl)->SetValue(site_data->m_server.GetProxyPass()); 1701 1645 1702 switch (site_data->m_server.GetEncodingType()) 1646 1703 { 1647 1704 default: … … 1708 1765 XRCCTRL(*this, "ID_ENCODING", wxTextCtrl)->Enable(checked); 1709 1766 } 1710 1767 1768 void CSiteManagerDialog::OnProxyChange(wxCommandEvent& event) 1769 { 1770 bool bUseProxy = false; 1771 if (XRCCTRL(*this, "ID_PROXYTYPE_HTTP", wxRadioButton)->GetValue()) 1772 { 1773 bUseProxy = true; 1774 } 1775 else if (XRCCTRL(*this, "ID_PROXYTYPE_SOCKS5", wxRadioButton)->GetValue()) 1776 { 1777 bUseProxy = true; 1778 } 1779 XRCCTRL(*this, "ID_BYPASSPROXY", wxCheckBox)->Enable(!bUseProxy); 1780 XRCCTRL(*this, "ID_PROXY_HOST", wxTextCtrl)->Enable(bUseProxy); 1781 XRCCTRL(*this, "ID_PROXY_PORT", wxTextCtrl)->Enable(bUseProxy); 1782 XRCCTRL(*this, "ID_PROXY_USER", wxTextCtrl)->Enable(bUseProxy); 1783 XRCCTRL(*this, "ID_PROXY_PASS", wxTextCtrl)->Enable(bUseProxy); 1784 } 1785 1711 1786 void CSiteManagerDialog::OnProtocolSelChanged(wxCommandEvent& event) 1712 1787 { 1713 1788 wxChoice* pProtocol = XRCCTRL(*this, "ID_PROTOCOL", wxChoice); -
src/interface/sitemanager_dialog.h
diff --strip-trailing-cr -Nur filezilla-3.7.3.orig/src/interface/sitemanager_dialog.h filezilla-3.7.3/src/interface/sitemanager_dialog.h
old new 80 80 void OnItemActivated(wxTreeEvent& event); 81 81 void OnLimitMultipleConnectionsChanged(wxCommandEvent& event); 82 82 void OnCharsetChange(wxCommandEvent& event); 83 void OnProxyChange(wxCommandEvent& event); 83 84 void OnProtocolSelChanged(wxCommandEvent& event); 84 85 void OnBeginDrag(wxTreeEvent& event); 85 86 void OnChar(wxKeyEvent& event); -
src/interface/xmlfunctions.cpp
diff --strip-trailing-cr -Nur filezilla-3.7.3.orig/src/interface/xmlfunctions.cpp filezilla-3.7.3/src/interface/xmlfunctions.cpp
old new 612 612 int maximumMultipleConnections = GetTextElementInt(node, "MaximumMultipleConnections"); 613 613 server.MaximumMultipleConnections(maximumMultipleConnections); 614 614 615 int proxyType = GetTextElementInt(node, "ProxyType"); 616 server.SetProxyType(proxyType); 617 wxString proxyHost = GetTextElement(node, "ProxyHost"); 618 server.SetProxyHost(proxyHost); 619 int proxyPort = GetTextElementInt(node, "ProxyPort"); 620 if (proxyPort < 1 || proxyPort > 65535) 621 proxyPort = 8080; 622 server.SetProxyPort(proxyPort); 623 wxString proxyUser = GetTextElement(node, "ProxyUser"); 624 server.SetProxyUser(proxyUser); 625 wxString proxyPass = GetTextElement(node, "ProxyPass"); 626 server.SetProxyPass(proxyPass); 627 615 628 wxString encodingType = GetTextElement(node, "EncodingType"); 616 629 if (encodingType == _T("Auto")) 617 630 server.SetEncodingType(ENCODING_AUTO); … … 711 724 } 712 725 AddTextElement(node, "MaximumMultipleConnections", server.MaximumMultipleConnections()); 713 726 727 AddTextElement(node, "ProxyType", server.GetProxyType()); 728 AddTextElement(node, "ProxyHost", server.GetProxyHost()); 729 AddTextElement(node, "ProxyPort", server.GetProxyPort()); 730 AddTextElement(node, "ProxyUser", server.GetProxyUser()); 731 AddTextElement(node, "ProxyPass", server.GetProxyPass()); 732 714 733 switch (server.GetEncodingType()) 715 734 { 716 735 case ENCODING_AUTO: