Summary: | inaccessible feeds block fetching | ||
---|---|---|---|
Product: | [Applications] akregator | Reporter: | quin <neko> |
Component: | general | Assignee: | kdepim bugs <kdepim-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: |
Description
quin
2004-09-29 11:21:18 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). 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. 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. 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); |