summaryrefslogtreecommitdiff
path: root/src/client/Client.cpp
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-08-08 17:34:37 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-08-08 17:34:37 (GMT)
commit346e9d21689c9616dae3f3d858071b7181979663 (patch)
treef42a76bc0096ed2231942d01620f752b5f150c39 /src/client/Client.cpp
parent73a18998f6791ae21a568996b5d0b884110b87d5 (diff)
downloadpowder-346e9d21689c9616dae3f3d858071b7181979663.zip
powder-346e9d21689c9616dae3f3d858071b7181979663.tar.gz
Proxy from command line arg
Diffstat (limited to 'src/client/Client.cpp')
-rw-r--r--src/client/Client.cpp24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/client/Client.cpp b/src/client/Client.cpp
index 64abe0e..56d436b 100644
--- a/src/client/Client.cpp
+++ b/src/client/Client.cpp
@@ -39,10 +39,10 @@ extern "C"
Client::Client():
authUser(0, ""),
- updateAvailable(false)
+ updateAvailable(false),
+ versionCheckRequest(NULL)
{
int i = 0;
- std::string proxyString("");
for(i = 0; i < THUMB_CACHE_SIZE; i++)
{
thumbnailCache[i] = NULL;
@@ -89,6 +89,10 @@ Client::Client():
}
configFile.close();
}
+}
+
+void Client::Initialise(std::string proxyString)
+{
if(GetPrefBool("version.update", false)==true)
{
@@ -96,15 +100,10 @@ Client::Client():
update_finish();
}
- proxyString = GetPrefString("proxy", "");
if(proxyString.length())
- {
- http_init((char *)proxyString.c_str());
- }
+ http_init((char*)proxyString.c_str());
else
- {
http_init(NULL);
- }
//Read stamps library
std::ifstream stampsLib;
@@ -125,6 +124,15 @@ Client::Client():
versionCheckRequest = http_async_req_start(NULL, SERVER "/Download/Version.json", NULL, 0, 1);
}
+void Client::SetProxy(std::string proxy)
+{
+ http_done();
+ if(proxy.length())
+ http_init((char*)proxy.c_str());
+ else
+ http_init(NULL);
+}
+
std::vector<std::string> Client::DirectorySearch(std::string directory, std::string search, std::string extension)
{
std::vector<std::string> extensions;