diff --git a/src/net/common/clientstate.cpp b/src/net/common/clientstate.cpp index ec5a09bd..32f5f4b0 100644 --- a/src/net/common/clientstate.cpp +++ b/src/net/common/clientstate.cpp @@ -258,7 +258,7 @@ ClientStateStartServerListDownload::Process(ClientThread &client) tmpServerListPath /= "serverlist.xml.z"; std::auto_ptr downloader(new DownloadHelper); - downloader->Init("http://pokerth.net/serverlist.xml.z", tmpServerListPath.directory_string()); + downloader->Init("pokerth.net/serverlist.xml.z", tmpServerListPath.directory_string()); ClientStateDownloadingServerList::Instance().SetDownloadHelper(downloader.release()); client.SetState(ClientStateDownloadingServerList::Instance()); diff --git a/src/net/common/downloadhelper.cpp b/src/net/common/downloadhelper.cpp index aa0427ad..f9850356 100644 --- a/src/net/common/downloadhelper.cpp +++ b/src/net/common/downloadhelper.cpp @@ -51,7 +51,7 @@ DownloadHelper::Init(const string &url, const string &targetFileName) { m_data->targetFile = fopen(targetFileName.c_str(), "wb"); m_data->curlHandle = curl_easy_init(); - m_data->curlMultiHandle = curl_multi_init(); + //m_data->curlMultiHandle = curl_multi_init(); // TODO throw exception on error @@ -59,13 +59,13 @@ DownloadHelper::Init(const string &url, const string &targetFileName) curl_easy_setopt(m_data->curlHandle, CURLOPT_WRITEFUNCTION, NULL); curl_easy_setopt(m_data->curlHandle, CURLOPT_WRITEDATA, m_data->targetFile); - curl_multi_add_handle(m_data->curlMultiHandle, m_data->curlHandle); + //curl_multi_add_handle(m_data->curlMultiHandle, m_data->curlHandle); } bool DownloadHelper::Process() { - bool retVal = false; + /*bool retVal = false; int runningHandles = 0; CURLMcode curlResult; do @@ -102,7 +102,9 @@ DownloadHelper::Process() Cleanup(); retVal = true; } - return retVal; + return retVal;*/ + curl_easy_perform(m_data->curlHandle); + return true; } void @@ -120,6 +122,7 @@ DownloadHelper::Cleanup() } if (m_data->targetFile) { + fflush(m_data->targetFile); fclose(m_data->targetFile); m_data->targetFile = NULL; }