From 577d837588f0cbc43aec53acca86adabd54b1c4c Mon Sep 17 00:00:00 2001 From: hikerstk Date: Wed, 27 Apr 2011 00:13:29 +0000 Subject: [PATCH] Removes tabs, added full path of downloaded file. git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@8467 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- src/addons/network_http.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/addons/network_http.cpp b/src/addons/network_http.cpp index ce6e3f330..adfa090a2 100644 --- a/src/addons/network_http.cpp +++ b/src/addons/network_http.cpp @@ -87,7 +87,7 @@ NetworkHttp::NetworkHttp() : m_news(std::vector()), { delete m_thread_id; m_thread_id = 0; - printf("[addons] Warning: could not create thread, error=%d.\n", errno); + printf("[addons] Warning: could not create thread, error=%d.\n", errno); } pthread_attr_destroy(&attr); } // NetworkHttp @@ -639,7 +639,7 @@ std::string NetworkHttp::downloadToStrInternal(std::string url) curl_easy_setopt(session, CURLOPT_URL, full_url.c_str()); std::string uagent = (std::string)"SuperTuxKart/" + STK_VERSION; curl_easy_setopt(session, CURLOPT_USERAGENT, uagent.c_str()); - curl_easy_setopt(session, CURLOPT_FOLLOWLOCATION, 1); + curl_easy_setopt(session, CURLOPT_FOLLOWLOCATION, 1); std::string fout; @@ -666,7 +666,8 @@ bool NetworkHttp::downloadFileInternal(const std::string &url, bool is_asynchron) { if(UserConfigParams::m_verbosity>=3) - printf("[addons] Downloading %s\n", url.c_str()); + printf("[addons] Downloading '%s' as '%s').\n", url.c_str(), + file_manager->getAddonsFile(save_filename).c_str()); CURL *session = curl_easy_init(); std::string full_url = url; if(url.substr(0, 5)!="http:" && url.substr(0, 4)!="ftp:") @@ -676,7 +677,8 @@ bool NetworkHttp::downloadFileInternal(const std::string &url, curl_easy_setopt(session, CURLOPT_URL, full_url.c_str()); std::string uagent = (std::string)"SuperTuxKart/" + STK_VERSION; curl_easy_setopt(session, CURLOPT_USERAGENT, uagent.c_str()); - curl_easy_setopt(session, CURLOPT_FOLLOWLOCATION, 1); + curl_easy_setopt(session, CURLOPT_FOLLOWLOCATION, 1); + FILE * fout = fopen(file_manager->getAddonsFile(save_filename).c_str(), "wb");