mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-16 23:22:31 +00:00
* 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:
@@ -50,12 +50,12 @@ PollManager::PollManager(torrent::Poll* poll) :
|
||||
throw std::logic_error("PollManager::PollManager(...) received poll == NULL");
|
||||
|
||||
#if defined USE_VARIABLE_FDSET
|
||||
m_setSize = m_poll->max_open_sockets() / 8;
|
||||
m_setSize = m_poll->get_open_max() / 8;
|
||||
m_readSet = (fd_set*)new char[m_setSize];
|
||||
m_writeSet = (fd_set*)new char[m_setSize];
|
||||
m_errorSet = (fd_set*)new char[m_setSize];
|
||||
#else
|
||||
if (m_poll->max_open_sockets() > FD_SETSIZE)
|
||||
if (m_poll->get_open_max() > FD_SETSIZE)
|
||||
throw std::logic_error("PollManager::PollManager(...) received a max open sockets >= FD_SETSIZE, but USE_VARIABLE_FDSET was not defined");
|
||||
|
||||
m_setSize = FD_SETSIZE / 8;
|
||||
|
||||
Reference in New Issue
Block a user