libtorrent
libtorrent copied to clipboard
Revisit 16-bit limitations
There are 16-bit limitations scattered throughout the libtorrent code base. For example, the maximum value for max_upload_rate and max_download_rate is 16 bits in KB/s, which is just 512 Mb/s. Since rtorrent has multiple threads, it accepts a maximum value of 5 times this value plus 10:
https://github.com/rakshasa/rtorrent/blob/master/src/ui/root.cc#L184
In [1]: (1 << 16) * 5 + 10
Out[1]: 327690
...which comes out to roughly 2.5 Gb/s.
Could some of these limitations be revisited?
[master] 15:50:07-$~/git/libtorrent $ egrep -r "<< 16" .
./src/net/address_list.cc: if (!b.has_key_value("port") || b.get_key_value("port") <= 0 || b.get_key_value("port") >= (1 << 16))
./src/torrent/connection_manager.cc: if (v < 1 || v >= (1 << 16))
./src/torrent/data/file_manager.cc: if (s < 4 || s > (1 << 16))
./src/torrent/download/resource_manager.cc: if (m > (1 << 16))
./src/torrent/download/resource_manager.cc: if (m > (1 << 16))
./src/torrent/download.cc: if (v > (1 << 16))
./src/torrent/download.cc: if (v > (1 << 16))
./src/torrent/download.cc: if (v > (1 << 16))
./src/torrent/download.cc: if (v > (1 << 16))
./src/torrent/peer/connection_list.cc: if (v > (1 << 16))
./src/torrent/peer/connection_list.cc: if (v > (1 << 16))
./src/tracker/tracker_udp.cc: m_port <= 0 || m_port >= (1 << 16))
./src/utils/sha_fast.cc:#define SHA_HTONL(x) (A = (x), A = (A << 16) | (A >> 16), \
./test/data/chunk_list_test.cc: chunk_list.set_chunk_size(1 << 16);
./test/data/chunk_list_test.cc: CPPUNIT_ASSERT(chunk_list.chunk_size() == (1 << 16));
./test/data/chunk_list_test.h: chunk_list->set_chunk_size(1 << 16); \
[master] 15:50:11-$~/git/libtorrent $
Wow, open for almost 3 years with no response or information. I'm pretty sure @rakshasa has abandoned this project for the most part.