* 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:
rakshasa
2005-12-05 07:59:29 +00:00
parent 32a3619cd8
commit ba7d61b532
15 changed files with 250 additions and 23 deletions
+24 -2
View File
@@ -37,9 +37,11 @@
#include "config.h"
#include <arpa/inet.h>
#include <netinet/in.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <torrent/exceptions.h>
#include <torrent/torrent.h>
#include <netinet/in.h>
#include "core/manager.h"
#include "ui/root.h"
@@ -55,7 +57,17 @@ OptionHandlerInt::process(const std::string& key, const std::string& arg) {
int a;
if (std::sscanf(arg.c_str(), "%i", &a) != 1)
throw torrent::input_error("Invalid argument for \"" + key + "\": \"" + arg + "\"");
throw torrent::input_error("Invalid argument for \"" + key + "\": \"" + arg + "\", must be an integer.");
m_apply(m_control, a);
}
void
OptionHandlerOctal::process(const std::string& key, const std::string& arg) {
int a;
if (std::sscanf(arg.c_str(), "%o", &a) != 1)
throw torrent::input_error("Invalid argument for \"" + key + "\": \"" + arg + "\", must be an octal.");
m_apply(m_control, a);
}
@@ -110,6 +122,11 @@ apply_global_upload_rate(Control* m, int arg) {
m->ui()->set_up_throttle(arg);
}
void
apply_umask(Control* m, int arg) {
umask(arg);
}
void
apply_hash_read_ahead(Control* m, int arg) {
torrent::set_hash_read_ahead(arg << 20);
@@ -185,6 +202,11 @@ apply_check_hash(Control* m, const std::string& arg) {
m->core()->set_check_hash(false);
}
void
apply_http_proxy(Control* m, const std::string& arg) {
m->core()->get_poll_manager()->get_http_stack()->set_http_proxy(arg);
}
void
apply_session_directory(Control* m, const std::string& arg) {
m->core()->get_download_store().use(arg);