Thanks; I added a call to curl_easy_escape(). -- David
On 13-Sep-2011 5:32 PM, Tom Ritter wrote: > I noticed this in 6.11.1, and it appears the code is the same here: > http://boinc.berkeley.edu/trac/browser/trunk/boinc/client/http_curl.cpp#L425 > > client/http_curl.cpp:425 > curl_easy_setopt(curlEasy, CURLOPT_URL, m_url); > > This does not urlescape characters, and can lead to download failures. > I noticed this with files with a space in the name. > > I corrected it with the following patch. This patch is wholly > insufficient for actual production use, but served to correct my > problem. I think you'd actually want to use > http://curl.haxx.se/libcurl/c/curl_easy_escape.html > But I'm not really familiar with libcurl. > > // the following seems to be a no-op > //curlErr = curl_easy_setopt(curlEasy, CURLOPT_ERRORBUFFER, error_msg); > > - curlErr = curl_easy_setopt(curlEasy, CURLOPT_URL, m_url); > + //Kind of important... > + char* escapedUrl = str_replace((const char *)m_url, " ", "%20"); > + curlErr = curl_easy_setopt(curlEasy, CURLOPT_URL, escapedUrl); > + //I'm not sure If I can call this immediately or not, so I'll just > leak the memory. > + //curl_free(escapedUrl); > > > + > // This option determines whether curl verifies that the server > // claims to be who you want it to be. > // When negotiating an SSL connection, > > > -tom > _______________________________________________ > boinc_dev mailing list > [email protected] > http://lists.ssl.berkeley.edu/mailman/listinfo/boinc_dev > To unsubscribe, visit the above URL and > (near bottom of page) enter your email address. _______________________________________________ boinc_dev mailing list [email protected] http://lists.ssl.berkeley.edu/mailman/listinfo/boinc_dev To unsubscribe, visit the above URL and (near bottom of page) enter your email address.
