[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdelibs/kio/kio
From:       Dawit Alemayehu <adawit () kde ! org>
Date:       2011-01-04 23:55:31
Message-ID: 20110104235531.0361CAC8B1 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1211792 by adawit:

- Fixed KIO::SchedulerPrivate::heldSlaveFor to correctly reuse ioslaves that are on hold.
  See http://svn.reviewboard.kde.org/r/6271/ for details.

BUG:148307
BUG:123121


 M  +14 -3     scheduler.cpp  


--- trunk/KDE/kdelibs/kio/kio/scheduler.cpp #1211791:1211792
@@ -902,6 +902,17 @@
     }
 }
 
+static bool mayReturnContent(int cmd, const QString& protocol)
+{
+    if (cmd == CMD_GET)
+        return true;
+
+    if (cmd == CMD_SPECIAL && protocol.startsWith(QLatin1String("http"), Qt::CaseInsensitive))
+        return true;
+
+    return false;
+}
+
 void SchedulerPrivate::doJob(SimpleJob *job)
 {
     kDebug(7006) << job;
@@ -912,7 +923,7 @@
     KIO::SimpleJobPrivate *const jobPriv = SimpleJobPrivate::get(job);
     jobPriv->m_protocol = KProtocolManager::slaveProtocol(job->url(), jobPriv->m_proxy);
 
-    if (jobCommand(job) == CMD_GET) {
+    if (mayReturnContent(jobCommand(job), jobPriv->m_protocol)) {
        jobPriv->m_checkOnHold = m_checkOnHold;
        m_checkOnHold = false;
     }
@@ -1138,14 +1149,14 @@
             canJobReuse = cmd == CMD_GET || cmd == CMD_SPECIAL;
             if (canJobReuse) {
                 KIO::MetaData outgoing = tJob->outgoingMetaData();
-                QString resume = outgoing.value("resume");
+                const QString resume = outgoing.value("resume");
                 kDebug(7006) << "Resume metadata is" << resume;
                 canJobReuse = resume.isEmpty() || resume == "0";
             }
         }
 
+        if (job->url() == m_urlOnHold) {
         if (canJobReuse) {
-            if (job->url() == m_urlOnHold) {
                 kDebug(7006) << "HOLD: Reusing held slave for" << m_urlOnHold;
                 slave = m_slaveOnHold;
             } else {
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic