Added resource for max open files.

Fixed bug that could cause infinit looping on SIGBUS.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@460 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2005-06-10 21:37:06 +00:00
parent 693ce38317
commit fdc56e8f09
7 changed files with 24 additions and 9 deletions
-8
View File
@@ -1,8 +1,6 @@
Polling during last phase of shutdown should be very quick, don't use Polling during last phase of shutdown should be very quick, don't use
normal timeout. normal timeout.
Make clear distinction of upload/download throttle.
Consider basing WindowPeer* on a common base class. Consider basing WindowPeer* on a common base class.
Some kind of indication that a tracker request was tried, but won't be Some kind of indication that a tracker request was tried, but won't be
@@ -21,12 +19,6 @@ Make accumulate return the value, no refs please...
> slow or broken or for various reasons you don't want to download it. > slow or broken or for various reasons you don't want to download it.
Show the bound listening ip.
Bug: Add the same torrent while it is hash checking.
Bug: Using ^s on a bad torrent does not catch the exception.
Show torrent creation date? Show torrent creation date?
Recheck hash key. Recheck hash key.
+3
View File
@@ -35,3 +35,6 @@
# while if too high the kernel might not be able to keep the read # while if too high the kernel might not be able to keep the read
# pages in memory thus end up trashing. # pages in memory thus end up trashing.
#hash_read_ahead = 10 #hash_read_ahead = 10
# Max number of files to keep open simultaniously.
#max_open_files = 100
+2
View File
@@ -33,6 +33,8 @@ struct CURLMsg;
namespace core { namespace core {
class CurlStack;
class CurlGet : public torrent::Http { class CurlGet : public torrent::Http {
public: public:
friend class CurlStack; friend class CurlStack;
+2
View File
@@ -27,6 +27,8 @@
namespace core { namespace core {
class CurlGet;
class CurlStack { class CurlStack {
public: public:
friend class CurlGet; friend class CurlGet;
+4
View File
@@ -121,6 +121,7 @@ initialize_option_handler(ui::Control* c, OptionHandler* optionHandler) {
optionHandler->insert("download_rate", new OptionHandlerInt(c, &apply_global_download_rate, &validate_rate)); optionHandler->insert("download_rate", new OptionHandlerInt(c, &apply_global_download_rate, &validate_rate));
optionHandler->insert("upload_rate", new OptionHandlerInt(c, &apply_global_upload_rate, &validate_rate)); optionHandler->insert("upload_rate", new OptionHandlerInt(c, &apply_global_upload_rate, &validate_rate));
optionHandler->insert("hash_read_ahead", new OptionHandlerInt(c, &apply_hash_read_ahead, &validate_read_ahead)); optionHandler->insert("hash_read_ahead", new OptionHandlerInt(c, &apply_hash_read_ahead, &validate_read_ahead));
optionHandler->insert("max_open_files", new OptionHandlerInt(c, &apply_max_open_files, &validate_fd));
optionHandler->insert("directory", new OptionHandlerDownloadString(dsm, &apply_download_directory, &validate_directory)); optionHandler->insert("directory", new OptionHandlerDownloadString(dsm, &apply_download_directory, &validate_directory));
@@ -243,6 +244,9 @@ main(int argc, char** argv) {
void void
do_panic(int signum) { do_panic(int signum) {
// Use the default signal handler in the future to avoid infint
// loops.
SignalHandler::set_default(signum);
display::Canvas::cleanup(); display::Canvas::cleanup();
std::cout << "Signal " << (signum == SIGSEGV ? "SIGSEGV" : "SIGBUS") << " recived, dumping stack:" << std::endl; std::cout << "Signal " << (signum == SIGSEGV ? "SIGSEGV" : "SIGBUS") << " recived, dumping stack:" << std::endl;
+10
View File
@@ -63,6 +63,11 @@ validate_read_ahead(int arg) {
return arg >= 1 && arg < 64; return arg >= 1 && arg < 64;
} }
bool
validate_fd(int arg) {
return arg >= 10 && arg < 1024;
}
void void
apply_download_min_peers(core::Download* d, int arg) { apply_download_min_peers(core::Download* d, int arg) {
d->get_download().set_peers_min(arg); d->get_download().set_peers_min(arg);
@@ -100,6 +105,11 @@ apply_hash_read_ahead(ui::Control* m, int arg) {
torrent::set_hash_read_ahead(arg << 20); torrent::set_hash_read_ahead(arg << 20);
} }
void
apply_max_open_files(ui::Control* m, int arg) {
torrent::set_max_open_files(arg);
}
void void
apply_bind(ui::Control* m, const std::string& arg) { apply_bind(ui::Control* m, const std::string& arg) {
torrent::set_bind(arg); torrent::set_bind(arg);
+2
View File
@@ -41,6 +41,7 @@ bool validate_port_range(const std::string& arg);
bool validate_download_peers(int arg); bool validate_download_peers(int arg);
bool validate_rate(int arg); bool validate_rate(int arg);
bool validate_read_ahead(int arg); bool validate_read_ahead(int arg);
bool validate_fd(int arg);
void apply_download_min_peers(core::Download* d, int arg); void apply_download_min_peers(core::Download* d, int arg);
void apply_download_max_peers(core::Download* d, int arg); void apply_download_max_peers(core::Download* d, int arg);
@@ -52,6 +53,7 @@ void apply_global_download_rate(ui::Control* m, int arg);
void apply_global_upload_rate(ui::Control* m, int arg); void apply_global_upload_rate(ui::Control* m, int arg);
void apply_hash_read_ahead(ui::Control* m, int arg); void apply_hash_read_ahead(ui::Control* m, int arg);
void apply_max_open_files(ui::Control* m, int arg);
void apply_ip(ui::Control* m, const std::string& arg); void apply_ip(ui::Control* m, const std::string& arg);
void apply_bind(ui::Control* m, const std::string& arg); void apply_bind(ui::Control* m, const std::string& arg);