mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-10-07 14:49:21 +00:00
* Moved http get's user agent stuff to the client. It now uses
"rtorrent/CLIENT_VERSION/LIBRARY_VERSION". * Using libcurl's timeout, set to 60 seconds, rather than in TrackerHttp. This should make libcurl try different IP's. * Minor cleanup of how file priorities are updated. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@594 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
+10
-4
@@ -81,12 +81,13 @@ CurlGet::start() {
|
||||
|
||||
m_handle = curl_easy_init();
|
||||
|
||||
curl_easy_setopt(m_handle, CURLOPT_URL, m_url.c_str());
|
||||
curl_easy_setopt(m_handle, CURLOPT_USERAGENT, m_userAgent.c_str());
|
||||
curl_easy_setopt(m_handle, CURLOPT_WRITEFUNCTION, &curl_get_receive_write);
|
||||
curl_easy_setopt(m_handle, CURLOPT_WRITEDATA, this);
|
||||
curl_easy_setopt(m_handle, CURLOPT_URL, m_url.c_str());
|
||||
curl_easy_setopt(m_handle, CURLOPT_WRITEFUNCTION, &curl_get_receive_write);
|
||||
curl_easy_setopt(m_handle, CURLOPT_WRITEDATA, this);
|
||||
curl_easy_setopt(m_handle, CURLOPT_TIMEOUT, 60);
|
||||
|
||||
curl_easy_setopt(m_handle, CURLOPT_FORBID_REUSE, 1);
|
||||
curl_easy_setopt(m_handle, CURLOPT_NOSIGNAL, 1);
|
||||
curl_easy_setopt(m_handle, CURLOPT_FOLLOWLOCATION, 1);
|
||||
curl_easy_setopt(m_handle, CURLOPT_MAXREDIRS, 5);
|
||||
|
||||
@@ -122,6 +123,11 @@ CurlGet::get_size_total() {
|
||||
return d;
|
||||
}
|
||||
|
||||
void
|
||||
CurlGet::set_user_agent(const char* s) {
|
||||
curl_easy_setopt(m_handle, CURLOPT_USERAGENT, s);
|
||||
}
|
||||
|
||||
void
|
||||
CurlGet::perform(CURLMsg* msg) {
|
||||
if (msg->msg != CURLMSG_DONE)
|
||||
|
||||
Reference in New Issue
Block a user