From: <hik...@us...> - 2011-06-23 12:03:21
|
Revision: 9020 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=9020&view=rev Author: hikerstk Date: 2011-06-23 12:03:15 +0000 (Thu, 23 Jun 2011) Log Message: ----------- Fixed error handling so that STK doesn't crash if it can't write downloaded data, see #280. Modified Paths: -------------- main/trunk/src/addons/network_http.cpp Modified: main/trunk/src/addons/network_http.cpp =================================================================== --- main/trunk/src/addons/network_http.cpp 2011-06-23 11:26:30 UTC (rev 9019) +++ main/trunk/src/addons/network_http.cpp 2011-06-23 12:03:15 UTC (rev 9020) @@ -480,6 +480,12 @@ curl_easy_setopt(m_curl_session, CURLOPT_PROGRESSDATA, request); FILE * fout = fopen((full_save+".part").c_str(), "wb"); + if(!fout) + { + printf("[addons] Can't open '%s' for writing, ignored.\n", + (full_save+".part").c_str()); + return CURLE_WRITE_ERROR; + } //from and out curl_easy_setopt(m_curl_session, CURLOPT_WRITEDATA, fout ); curl_easy_setopt(m_curl_session, CURLOPT_WRITEFUNCTION, fwrite); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |