* Automagically set the max open sockets and files to resonable values

according to sysconf(_SC_OPEN_MAX).

* Added timeout to torrent::TrackerHttp so connections that are left
open, but with no data being transmitted get closed after a resonable
time.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@524 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2005-08-12 16:05:54 +00:00
parent 202ed7928b
commit 407f3383f0
7 changed files with 39 additions and 47 deletions
+1 -1
View File
@@ -70,7 +70,7 @@ print_download_info(char* buf, unsigned int length, core::Download* d) {
(double)d->get_download().get_bytes_done() / (double)(1 << 20),
(double)d->get_download().get_bytes_total() / (double)(1 << 20)));
buf += std::max(0, snprintf(buf, last - buf, " Rate: %5.1f / %5.1f KiB Uploaded: %.1f MiB",
buf += std::max(0, snprintf(buf, last - buf, " Rate: %5.1f / %5.1f KB Uploaded: %.1f MB",
(double)d->get_download().get_write_rate().rate() / (1 << 10),
(double)d->get_download().get_read_rate().rate() / (1 << 10),
(double)d->get_download().get_write_rate().total() / (1 << 20)));
+5 -3
View File
@@ -72,7 +72,7 @@ WindowStatusbar::redraw() {
else
pos = snprintf(buf + pos, 128 - pos, "%-3i", torrent::get_read_throttle() / 1024);
m_canvas->print(0, 0, "Throttle U/D: %s Rate: %5.1f / %5.1f KiB Listen: %s:%i%s",
m_canvas->print(0, 0, "Throttle U/D: %s Rate: %5.1f / %5.1f KB Listen: %s:%i%s",
buf,
(double)torrent::get_write_rate().rate() / 1024.0,
(double)torrent::get_read_rate().rate() / 1024.0,
@@ -80,10 +80,12 @@ WindowStatusbar::redraw() {
(int)torrent::get_listen_port(),
!torrent::get_bind_address().empty() ? (" Bind: " + torrent::get_bind_address()).c_str() : "");
pos = snprintf(buf, 128, "[%3i/%3i/%3i]",
pos = snprintf(buf, 128, "[S %i/%i/%i] [F %i/%i]",
torrent::get_total_handshakes(),
torrent::get_open_sockets(),
torrent::get_max_open_sockets());
torrent::get_max_open_sockets(),
torrent::get_open_files(),
torrent::get_max_open_files());
m_canvas->print(m_canvas->get_width() - pos, 0, "%s", buf);
}