[Libtorrent-devel] Re: libTorrent 0.9.0 and rTorrent 0.5.0 released

Chris Frey cdfrey at foursquare.net
Fri Apr 7 17:41:34 UTC 2006


On Thu, Apr 06, 2006 at 07:48:24PM +0200, Jari Petter Sundell wrote:
> This release took a while to finish as all the API changing stuff I had 
> planned needed to be finished. Rewrote a few things like address handling 
> (ipv6 ready), handshakes, chunk selection, etc. So expect bugs.

I'm trying to load a torrent of a complete file.  It loads as normal
and goes through the hash check.  As soon as the hash check is finished,
I get the following error:

rtorrent: Poll::work(): select error (from poll_manager_select: select == -1), errno = 9, strerror() = Bad file descriptor

I used the patch below to give the error message a bit more info.  Not sure
if it helps.

- Chris



diff -ru rtorrent-0.5.0/src/core/poll_manager.cc rtorrent-0.5.0-test/src/core/poll_manager.cc
--- rtorrent-0.5.0/src/core/poll_manager.cc	2006-01-21 15:51:44.000000000 -0500
+++ rtorrent-0.5.0-test/src/core/poll_manager.cc	2006-04-07 13:23:23.000000000 -0400
@@ -38,6 +38,7 @@
 
 #include <cerrno>
 #include <stdexcept>
+#include <sstream>
 
 #include "poll_manager.h"
 
@@ -92,9 +93,12 @@
 }
 
 void
-PollManager::check_error() {
-  if (errno != EINTR)
-    throw std::runtime_error("Poll::work(): select error");
+PollManager::check_error(const char *msg) {
+  if (errno != EINTR) {
+    std::ostringstream oss;
+    oss << "Poll::work(): select error (from " << msg << "), errno = " << errno << ", strerror() = " << strerror(errno);
+    throw std::runtime_error(oss.str());
+  }
 }
 
 }
diff -ru rtorrent-0.5.0/src/core/poll_manager.h rtorrent-0.5.0-test/src/core/poll_manager.h
--- rtorrent-0.5.0/src/core/poll_manager.h	2006-01-21 15:51:07.000000000 -0500
+++ rtorrent-0.5.0-test/src/core/poll_manager.h	2006-04-07 13:20:56.000000000 -0400
@@ -67,7 +67,7 @@
   PollManager(const PollManager&);
   void operator = (const PollManager&);
 
-  void                check_error();
+  void                check_error(const char *msg);
 
   torrent::Poll*      m_poll;
   CurlStack           m_httpStack;
diff -ru rtorrent-0.5.0/src/core/poll_manager_epoll.cc rtorrent-0.5.0-test/src/core/poll_manager_epoll.cc
--- rtorrent-0.5.0/src/core/poll_manager_epoll.cc	2006-01-09 19:33:11.000000000 -0500
+++ rtorrent-0.5.0-test/src/core/poll_manager_epoll.cc	2006-04-07 13:20:56.000000000 -0400
@@ -87,7 +87,7 @@
     timeval t = timeout.tval();
 
     if (select(maxFd + 1, m_readSet, m_writeSet, m_errorSet, &t) == -1)
-      return check_error();
+      return check_error("poll_manager_epoll: select == -1");
 
     m_httpStack.perform();
 
@@ -106,7 +106,7 @@
   // function. ;)
 
   if (static_cast<torrent::PollEPoll*>(m_poll)->poll((timeout.usec() + 999) / 1000) == -1)
-    return check_error();
+    return check_error("poll_manager_epoll: PollEPoll->poll() == -1");
 
   torrent::perform();
   static_cast<torrent::PollEPoll*>(m_poll)->perform();
diff -ru rtorrent-0.5.0/src/core/poll_manager_select.cc rtorrent-0.5.0-test/src/core/poll_manager_select.cc
--- rtorrent-0.5.0/src/core/poll_manager_select.cc	2006-01-09 19:33:11.000000000 -0500
+++ rtorrent-0.5.0-test/src/core/poll_manager_select.cc	2006-04-07 13:20:56.000000000 -0400
@@ -83,7 +83,7 @@
   timeval t = timeout.tval();
 
   if (select(maxFd + 1, m_readSet, m_writeSet, m_errorSet, &t) == -1)
-    return check_error();
+    return check_error("poll_manager_select: select == -1");
 
   if (m_httpStack.is_busy())
     m_httpStack.perform();



More information about the Libtorrent-devel mailing list