On Sun, Oct 06, 2024 at 07:35:35PM GMT, Anon Loli wrote: > Bug 2: > After some uneven time (0-15 minutes), SOME torrents just get Stalled after > downloading (although I think that some never even get started). > I could not find any correlation between settings and whatnot. > The network is not at fault, and neither is the tracker. > Not only has this been tested against different internet accesses and ISPs, it > has also been tested with clearnet and I2P, and I2P is anonymous so ISP can't > even figure out if torrenting is happening even if they wanted to. > > And torrenting worked fine on FreeBSD's qBittorent, although this was another > computer. I will probably try another disk or something soon, but I very very > doubt that this could be the cause of bug 2. > > > What could be doing this? I for a long time thought that it was a I2P-specific > thing until I noticed that it also happens to clearnet torrents. > Default settings cause this too. > > This bug has been ongoing for many months. > What helps is restarting qBittorrent.
By any chance, do you run qBittorrent in a rtable(4) other than 0? If that's the case, you should give the patch below for a try. It adds support for that in net/libtorrent-rasterbar. Lucas diff refs/heads/master 5f9358822aa6dc0cae458e40f270f49d993ab794 commit - 5324f947be0d2b037a14f27d27648042f2d6d540 commit + 5f9358822aa6dc0cae458e40f270f49d993ab794 blob - /dev/null blob + af98cf7356538a61309d71dcffb8805bdeb0261f (mode 644) --- /dev/null +++ net/libtorrent-rasterbar/patches/patch-src_enum_net_cpp @@ -0,0 +1,48 @@ +Request routes for current rtable. + +Index: src/enum_net.cpp +--- src/enum_net.cpp.orig ++++ src/enum_net.cpp +@@ -1146,13 +1146,19 @@ int _System __libsocket_sysctl(int* mib, u_int namelen + } + ::close(s); + */ ++#define nelems(_a) (sizeof((_a)) / sizeof((_a)[0])) ++ ++#ifdef __OpenBSD__ ++ int mib[7] = {CTL_NET, PF_ROUTE, 0, AF_UNSPEC, NET_RT_DUMP, 0, getrtable()}; ++#else + int mib[6] = {CTL_NET, PF_ROUTE, 0, AF_UNSPEC, NET_RT_DUMP, 0}; ++#endif + + std::size_t needed = 0; + #ifdef TORRENT_OS2 +- if (__libsocket_sysctl(mib, 6, 0, &needed, 0, 0) < 0) ++ if (__libsocket_sysctl(mib, nelems(mib), 0, &needed, 0, 0) < 0) + #else +- if (sysctl(mib, 6, nullptr, &needed, nullptr, 0) < 0) ++ if (sysctl(mib, nelems(mib), nullptr, &needed, nullptr, 0) < 0) + #endif + { + ec = error_code(errno, system_category()); +@@ -1172,9 +1178,9 @@ int _System __libsocket_sysctl(int* mib, u_int namelen + } + + #ifdef TORRENT_OS2 +- if (__libsocket_sysctl(mib, 6, buf.get(), &needed, 0, 0) < 0) ++ if (__libsocket_sysctl(mib, nelems(mib), buf.get(), &needed, 0, 0) < 0) + #else +- if (sysctl(mib, 6, buf.get(), &needed, nullptr, 0) < 0) ++ if (sysctl(mib, nelems(mib), buf.get(), &needed, nullptr, 0) < 0) + #endif + { + ec = error_code(errno, system_category()); +@@ -1204,6 +1210,8 @@ int _System __libsocket_sysctl(int* mib, u_int namelen + ip_route r; + if (parse_route(s, rtm, &r)) ret.push_back(r); + } ++#undef nelems ++ + #elif TORRENT_USE_GETIPFORWARDTABLE + /* + move this to enum_net_interfaces