From 7370ce0cd0473600c6a45260bab200050f1d2616 Mon Sep 17 00:00:00 2001 From: Rom Walton Date: Mon, 25 Oct 2004 16:14:51 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=4422 --- clientgui/MainDocument.cpp | 35 +++++++++++++++++++++++++++++++++++ clientgui/MainDocument.h | 26 ++++++++++++++++++++++++++ lib/gui_rpc_client.C | 10 ++++++++++ 3 files changed, 71 insertions(+) diff --git a/clientgui/MainDocument.cpp b/clientgui/MainDocument.cpp index 8bb64648bb..dc67c2dae2 100644 --- a/clientgui/MainDocument.cpp +++ b/clientgui/MainDocument.cpp @@ -1378,3 +1378,38 @@ wxInt32 CMainDocument::GetResourceDiskspace( wxInt32 iIndex, float& fBuffer ) return 0; } + +wxInt32 CMainDocument::GetProxyInfo() +{ + wxInt32 retval = 0; + + retval = rpc.get_proxy_settings(proxy_info); + if (retval) + { + wxLogTrace("CMainDocument::GetProxyInfo - Get Proxy Info Failed '%d'", retval); + proxy_info.clear(); + } + + return retval; +} + + +wxInt32 CMainDocument::SetProxyInfo() +{ + wxInt32 retval = 0; + + retval = rpc.set_proxy_settings(proxy_info); + if (retval) + { + wxLogTrace("CMainDocument::SetProxyInfo - Set Proxy Info Failed '%d'", retval); + proxy_info.clear(); + } + + return retval; +} + + + + + + diff --git a/clientgui/MainDocument.h b/clientgui/MainDocument.h index 9145b2d1a8..648cb12b96 100644 --- a/clientgui/MainDocument.h +++ b/clientgui/MainDocument.h @@ -233,6 +233,32 @@ public: wxInt32 GetResourceProjectName( wxInt32 iIndex, wxString& strBuffer ); wxInt32 GetResourceDiskspace( wxInt32 iIndex, float& fBuffer ); + + // + // Proxy Configuration + // +private: + + PROXY_INFO proxy_info; + +public: + + wxInt32 GetProxyInfo(); + wxInt32 SetProxyInfo(); + + bool use_http_proxy; + bool use_socks_proxy; + bool use_http_authentication; + int socks_version; + std::string socks_server_name; + std::string http_server_name; + int socks_server_port; + int http_server_port; + std::string http_user_name; + std::string http_user_passwd; + std::string socks5_user_name; + std::string socks5_user_passwd; + }; #endif diff --git a/lib/gui_rpc_client.C b/lib/gui_rpc_client.C index 3e2f2e0891..bef90ffe14 100644 --- a/lib/gui_rpc_client.C +++ b/lib/gui_rpc_client.C @@ -1277,6 +1277,16 @@ int RPC_CLIENT::set_proxy_settings(PROXY_INFO& pi) { return rpc.do_rpc(buf); } +int RPC_CLIENT::get_proxy_settings(PROXY_INFO& p) { + RPC rpc(this); + int retval; + + retval = rpc.do_rpc(""); + if (retval) return retval; + + return p.parse(rpc.fin); +} + int RPC_CLIENT::get_messages(int seqno, MESSAGES& msgs) { char buf[4096]; RPC rpc(this);