httprpc: restore d.state on unpause so torrents leave the paused state#3129
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The httprpc
unpauseaction sends onlyd.resume, which restarts data transfer but leavesd.state=0from pause'sd.stop. Since ruTorrent flags any open torrent withd.state=0as paused (js/rtorrent.js), an unpaused torrent:This PR makes
unpausesendd.startinstead, matching what the direct XML-RPC mount already does (rTorrentStub.prototype.unpauseinjs/rtorrent.jssendsd.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
Made with Cursor