Skip to content

Commit ba37e05

Browse files
authored
Fix for broken RSS feeds break the rutorrent. (#2894)
As much as I tested it will still load Feeds now from cache even if the feed is broken or unavailable. Before it just did not load Feeds at all and start looping some error message. rtorrent down or something like that. Dont remember anymore. But that problem happened when there was many broken feeds. Only one then it was no problem but i had like 5 broken feeds and no feeds get loaded. Not even the good ones.
1 parent 5e44515 commit ba37e05

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

plugins/rss/rss.php

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,18 @@ public function fetch( $history )
143143
$headers['If-Last-Modified'] = $this->lastModified;
144144
$cli = call_user_func($this->fetchURL, $this->url, $this->cookies, $headers);
145145
if($cli->status<200 || $cli->status>=300) {
146-
if ($cli->status!==304) {
147-
$this->lastErrorMsgs[] = $cli->status == -100 ? '[RSS-Timeout]' :
148-
($cli->status < 100 ? '[RSS-Connection-Error] '.$cli->error : '[RSS-HTTP-Error] Status: '.$cli->status);
149-
}
146+
if ($cli->status !== 304) {
147+
$msg = $cli->status == -100
148+
? '[RSS-Timeout]'
149+
: ($cli->status < 100
150+
? '[RSS-Connection-Error] ' . $cli->error
151+
: '[RSS-HTTP-Error] Status: ' . $cli->status);
152+
153+
$this->lastErrorMsgs[] = $msg;
154+
return false;
155+
}
150156
// true if feed not modified
151-
return($cli->status===304);
157+
return true;
152158
}
153159

154160
// remember etag and lastModified

0 commit comments

Comments
 (0)