* Clear the download rate when finishing a torrent.

* Fixed torrent::set_{bind,local}_address(...) so they update
correctly.

* Tweaked the time left display, show minutes instead of seconds.

* Add earlier check on validity of the socket address of
incoming/outgoing connection.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@610 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2005-12-18 23:49:00 +00:00
parent e45f05ee98
commit 4e8e5a18df
6 changed files with 33 additions and 24 deletions
+3 -3
View File
@@ -245,18 +245,18 @@ Manager::receive_download_done(Download* d) {
void
Manager::listen_open() {
if (m_portFirst > m_portLast)
throw std::runtime_error("Invalid port range for listening");
throw torrent::input_error("Invalid port range for listening");
if (m_portRandom) {
int boundary = m_portFirst + random() % (m_portLast - m_portFirst + 1);
if (!torrent::listen_open(boundary, m_portLast) &&
!torrent::listen_open(m_portFirst, boundary))
throw std::runtime_error("Could not open port for listening.");
throw torrent::input_error("Could not open/bind a port for listening.");
} else {
if (!torrent::listen_open(m_portFirst, m_portLast))
throw std::runtime_error("Could not open port for listening.");
throw torrent::input_error("Could not open/bind a port for listening.");
}
}
+2 -2
View File
@@ -79,6 +79,8 @@ public:
void initialize_second();
void cleanup();
void listen_open();
void shutdown(bool force);
DListItr insert(std::istream* s);
@@ -92,8 +94,6 @@ public:
void push_log(const std::string& msg) { m_logImportant.push_front(msg); m_logComplete.push_front(msg); }
private:
void listen_open();
void create_http(const std::string& uri);
void create_final(std::istream* s);