Xirvik Support 49625ab5e5 rpc: close SCGI task on EPIPE to stop event_write() busy-loop
When an SCGI client closes the connection before rtorrent finishes sending
the response, send() in SCgiTask::event_write() returns -1 with errno EPIPE.
EPIPE was grouped with EAGAIN/EINTR as a non-fatal retry-later condition, so
the task was not closed and its descriptor stayed registered for EPOLLOUT. A
broken socket is reported writable immediately, so epoll_wait() returns it on
every iteration and the SCGI thread spins at 100% CPU on one core
indefinitely. The dead connection fd is also leaked (stays ESTAB).

EPIPE is terminal here, not retryable: the peer is gone and the response can
never be delivered. Close the task on EPIPE, matching event_read(), which
already closes on any recv() error other than EAGAIN/EINTR.

Reproduction: open the SCGI socket, send a complete RPC request, then
shutdown(SHUT_RDWR)/close before reading the reply. Stock: the rtorrent-scgi
thread goes to 100% CPU and the connection leaks. With this change: CPU stays
at 0% and the descriptor is closed.
2026-06-04 10:41:19 +02:00
2026-04-10 22:04:02 +09:00
2026-06-01 20:11:02 +09:00
2026-06-01 20:11:02 +09:00
2014-09-15 16:03:10 +09:00
2026-06-03 10:18:25 +02:00
2005-01-25 18:47:10 +00:00
2025-10-02 16:31:53 +09:00

RTorrent BitTorrent Client

Introduction

A ncurses-based command line torrent client for high performance.

To learn how to use rTorrent visit the Wiki.

Download the latest stable release

Donate to rTorrent development

  • Paypal
  • Patreon
  • SubscribeStar
  • Bitcoin: 1MpmXm5AHtdBoDaLZstJw8nupJJaeKu8V8
  • Ethereum: 0x9AB1e3C3d8a875e870f161b3e9287Db0E6DAfF78
  • Litecoin: LdyaVR67LBnTf6mAT4QJnjSG2Zk67qxmfQ
  • Cardano: addr1qytaslmqmk6dspltw06sp0zf83dh09u79j49ceh5y26zdcccgq4ph7nmx6kgmzeldauj43254ey97f3x4xw49d86aguqwfhlte

Help keep rTorrent development going by donating to its creator.

BUILDING

Jump into the github cloned directory

cd rtorrent

Install build dependencies

Install libtorrent with the same version rTorrent.

Generate configure scripts:

autoreconf -ivf

Optionally, generate man pages:

docbook2man rtorrent.1.xml

Man pages output to "doc/rtorrent.1".

RTorrent follows the development of libtorrent closely, and thus the versions must be in sync.

USAGE

Refer to User Guide: https://github.com/rakshasa/rtorrent/wiki/User-Guide

LICENSE

GNU GPL, see COPYING. "libtorrent/src/utils/sha_fast.{cc,h}" is originally from the Mozilla NSS and is under a triple license; MPL, LGPL and GPL. An exception to non-NSS code has been added for linking to OpenSSL as requested by Debian, though the author considers that library to be part of the Operative System and thus linking is allowed according to the GPL.

Use whatever fits your purpose, the code required to compile with Mozilla's NSS implementation of SHA1 has been retained and can be compiled if the user wishes to avoid using OpenSSL.

DEPENDENCIES

  • libcurl >= 7.12.0
  • libtorrent = (same version)
  • ncurses

BUILD DEPENDENCIES

  • libtoolize
  • aclocal
  • autoconf
  • autoheader
  • automake
S
Description
Languages
C++ 93.4%
M4 6%
Makefile 0.3%
Lua 0.2%
C 0.1%