Bug 90457 - inaccessible feeds block fetching
Summary: inaccessible feeds block fetching
Status: RESOLVED FIXED
Alias: None
Product: akregator
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-29 11:21 UTC by quin
Modified: 2004-12-14 09:40 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description quin 2004-09-29 11:21:18 UTC
Version:           1.0-beta6 "Bezerkus" (using KDE 3.2.3, SuSE)
Compiler:          gcc version 3.3 20030226 (prerelease) (SuSE Linux)
OS:                Linux (i686) release 2.4.20-4GB-athlon

When a RSS feed is inaccessible (e.g. because the server is offline), it causes Akregator to get stuck trying to fetch this feed (fetch buttons greyed-out).
There should be a (preferrably configurable) timeout after which Akregator will skip inaccessible feeds, mark them as "inaccessible" with a different font-style or icon, and skip to the next feed.
A button for manually cancelling the fetch process would also be nice.
Comment 1 quin 2004-09-29 11:24:32 UTC
Oops... I just noticed there seems to be a "cancel" button, but it does not appear to work until all feeds have been fetched after startup and it does not show up when Akregator is embedded in Kontact (therefore I did not notice it at first).
Comment 2 Teemu Rytilahti 2004-09-29 17:38:33 UTC
Yes, you aren't the only one who have noticed that the cancel button is disabled when fetching on startup. I've also talked about setting some kind of timeout delay (or maybe changing kio_http's one somehow?) for fetching.
Comment 3 Pierre Habouzit 2004-09-29 21:23:55 UTC
and why not beeing smarter and authorizing to fetch again, even if the last fetch is not done ?

I mean we should set a flag on each feed saying if we already started a fetch (I guess it's already done, since the icon is gray-ed while fetching atm ...). and if the user ask for a new fetch, we only fetch feeds that have their flag off.
Comment 4 Frank Osterfeld 2004-12-14 09:40:09 UTC
CVS commit by osterfeld: 

Add timeout of 90 sec, after which a fetch is canceled. 
So a non-responding site can't block the transaction forever.
Note to self: Improve that when refactoring librss

BUG: 90457 


  M +17 -0     loader.cpp   1.15
  M +3 -0      loader.h   1.4


--- kdepim/akregator/src/librss/loader.cpp  #1.14:1.15
@@ -20,4 +20,5 @@
 #include <qregexp.h>
 #include <qstringlist.h>
+#include <qtimer.h>
 
 using namespace RSS;
@@ -73,4 +74,8 @@ void FileRetriever::retrieveData(const K
 
    d->job = KIO::get(u, true, false);
+
+   
+   QTimer::singleShot(1000*90, this, SLOT(slotTimeout()));
+   
    connect(d->job, SIGNAL(data(KIO::Job *, const QByteArray &)),
                 SLOT(slotData(KIO::Job *, const QByteArray &)));
@@ -80,4 +85,16 @@ void FileRetriever::retrieveData(const K
 }
 
+void FileRetriever::slotTimeout()
+{
+    abort();
+
+    delete d->buffer;
+    d->buffer = NULL;
+
+    d->lastError = KIO::ERR_SERVER_TIMEOUT;
+    
+    emit dataRetrieved(QByteArray(), false);
+}
+
 int FileRetriever::errorCode() const
 {

--- kdepim/akregator/src/librss/loader.h  #1.3:1.4
@@ -130,4 +130,7 @@ namespace RSS
                         void permanentRedirection(const KURL &url);
 
+        protected slots:
+            void slotTimeout();
+                
                 private slots:
                         void slotData(KIO::Job *job, const QByteArray &data);