[aKregator-devel] [Bug 90457] inaccessible feeds block fetching
Brought to you by:
lippel
From: Frank O. <fra...@kd...> - 2004-12-14 08:40:25
|
------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. http://bugs.kde.org/show_bug.cgi?id=90457 frank.osterfeld kdemail net changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED ------- Additional Comments From frank.osterfeld kdemail net 2004-12-14 09:40 ------- 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); |