mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-15 14:42:30 +00:00
* Fixed a buffer overflow when writting to the output buffer. This
would in some rare occasions cause memory to be corrupted. leading to a crash. * Added option for setting the http proxy and proccess's umask. * Save the total uploaded for downloads between sessions. * Moved from sigc++ to my own lightweight slot class for the task scheduler. This saves some 5-600kb when compiled with debugging symbols, 1-200kb without. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@605 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
@@ -132,6 +132,11 @@ CurlGet::set_user_agent(const char* s) {
|
||||
curl_easy_setopt(m_handle, CURLOPT_USERAGENT, s);
|
||||
}
|
||||
|
||||
void
|
||||
CurlGet::set_http_proxy(const char* s) {
|
||||
curl_easy_setopt(m_handle, CURLOPT_PROXY, s);
|
||||
}
|
||||
|
||||
void
|
||||
CurlGet::perform(CURLMsg* msg) {
|
||||
if (msg->msg != CURLMSG_DONE)
|
||||
|
||||
@@ -67,6 +67,7 @@ class CurlGet : public torrent::Http {
|
||||
double size_total();
|
||||
|
||||
void set_user_agent(const char* s);
|
||||
void set_http_proxy(const char* s);
|
||||
|
||||
protected:
|
||||
CURL* handle() { return m_handle; }
|
||||
|
||||
@@ -103,7 +103,11 @@ CurlStack::fdset(fd_set* readfds, fd_set* writefds, fd_set* exceptfds) {
|
||||
|
||||
void
|
||||
CurlStack::add_get(CurlGet* get) {
|
||||
get->set_user_agent(m_userAgent.c_str());
|
||||
if (!m_userAgent.empty())
|
||||
get->set_user_agent(m_userAgent.c_str());
|
||||
|
||||
if (!m_httpProxy.empty())
|
||||
get->set_http_proxy(m_httpProxy.c_str());
|
||||
|
||||
CURLMcode code;
|
||||
|
||||
|
||||
@@ -68,6 +68,9 @@ class CurlStack {
|
||||
const std::string& user_agent() const { return m_userAgent; }
|
||||
void set_user_agent(const std::string& s) { m_userAgent = s; }
|
||||
|
||||
const std::string& http_proxy() const { return m_httpProxy; }
|
||||
void set_http_proxy(const std::string& s) { m_httpProxy = s; }
|
||||
|
||||
static void global_init();
|
||||
static void global_cleanup();
|
||||
|
||||
@@ -85,6 +88,7 @@ class CurlStack {
|
||||
CurlGetList m_getList;
|
||||
|
||||
std::string m_userAgent;
|
||||
std::string m_httpProxy;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -61,10 +61,10 @@ DownloadFactory::DownloadFactory(const std::string& uri, Manager* m) :
|
||||
m_start(false) {
|
||||
|
||||
m_taskLoad.set_iterator(taskScheduler.end());
|
||||
m_taskLoad.set_slot(sigc::mem_fun(*this, &DownloadFactory::receive_load));
|
||||
m_taskLoad.set_slot(rak::mem_fn(this, &DownloadFactory::receive_load));
|
||||
|
||||
m_taskCommit.set_iterator(taskScheduler.end());
|
||||
m_taskCommit.set_slot(sigc::mem_fun(*this, &DownloadFactory::receive_commit));
|
||||
m_taskCommit.set_slot(rak::mem_fn(this, &DownloadFactory::receive_commit));
|
||||
}
|
||||
|
||||
DownloadFactory::~DownloadFactory() {
|
||||
|
||||
Reference in New Issue
Block a user