Skip to content

httprpc: restore d.state on unpause so torrents leave the paused state#3129

Merged
xirvik merged 1 commit into
Novik:masterfrom
xombiemp:fix-httprpc-unpause-state
Jul 24, 2026
Merged

httprpc: restore d.state on unpause so torrents leave the paused state#3129
xirvik merged 1 commit into
Novik:masterfrom
xombiemp:fix-httprpc-unpause-state

Conversation

@xombiemp

Copy link
Copy Markdown
Collaborator

Summary

The httprpc unpause action sends only d.resume, which restarts data transfer but leaves d.state=0 from pause's d.stop. Since ruTorrent flags any open torrent with d.state=0 as paused (js/rtorrent.js), an unpaused torrent:

  • stays displayed as "Pausing" indefinitely while data actually flows, and
  • is treated as user-stopped by rtorrent on its next restart (it won't auto-start).

This PR makes unpause send d.start instead, matching what the direct XML-RPC mount already does (rTorrentStub.prototype.unpause in js/rtorrent.js sends d.start), so the two transports agree.

Repro

On a stock install using httprpc: click the toolbar Pause button twice on a downloading torrent. Transfers resume, but the status stays "Pausing" until the torrent is started and paused again.

Test plan

  • Pause a downloading torrent (status: Pausing, transfer stops)
  • Pause it again (= unpause): transfer resumes and status returns to Downloading
  • Restart rtorrent after an unpause: the torrent starts again as expected

Made with Cursor

The unpause action sent only d.resume, which restarts data transfer
but leaves d.state=0 from pause's d.stop. ruTorrent flags any open
torrent with d.state=0 as paused, so an unpaused torrent stays shown
as "Pausing" forever while data flows, and rtorrent treats it as
user-stopped on its next restart.

Send d.start instead, matching the direct XML-RPC mount's unpause stub
(rTorrentStub.prototype.unpause in js/rtorrent.js).

Repro on a stock install with httprpc: click the toolbar Pause button
twice on a downloading torrent - transfers resume but the status stays
"Pausing" until the torrent is started and paused again.
@xirvik
xirvik merged commit 3e3454c into Novik:master Jul 24, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants