podcast: fix podcast episode download stuck in 'Waiting' state
This MR fixes all side effects of not closing the podcast download input stream. Podcast download will always be stuck after 2 transactions. This is due to libsoup ( current gvfs http backend ) max-conns-per-host
property ( which is 2 by default )
Ref: https://developer.gnome.org/libsoup/stable/SoupSession.html#SoupSession--max-conns-per-host
The fix is to close the podcast download input stream in all cases.
Couple of scenarios which will trigger this issue.
Scenario 1:
- Subscribe to new podcast feed.
- Download 5 episodes.
- Delete feed from feed menu. ( Delete Feed Only )
- Subscribe to same podcast feed in Step 1.
- Download same 5 episodes in Step 2.
- After 2 episode downloads successfully ( loading from local file ), other 3 episodes will be in 'Waiting' state.
- If Rhythmbox is restarted, 2 other episode downloads will succeed, but the 5th one will be in 'Waiting' state.
Similar to this screenshot
Scenario 2:
- Subscribe to new podcast feed.
- Download 1 episode.
- Go to the episode download directory and remove directory write permissions (
chmod a-w .
) - Download more episodes.
- After 2 episode download failures, other episode downloads will be in 'Waiting' state.
- If Rhythmbox is restarted, 2 other episode downloads will fail, but the others will be in 'Waiting' state.
Similar to this screenshot