Index: kio/DESIGN.metadata
===================================================================
--- kio/DESIGN.metadata	(revision 1119700)
+++ kio/DESIGN.metadata	(working copy)
@@ -5,7 +5,23 @@
 the behavior of a slave and is usally protocol dependent. MetaData consists
 of two strings: a "key" and a "value".
 
+Any meta data whose "key" starts with the keyword "_kio_internal_[0-1]_" is
+marked as internal metadata and will not be accessable at the application level.
+Internal meta-data key/value pairs will simply be stored and sent back to all
+ioslave of the same type depending on the [0-1] flag.
 
+The flags in the internal meta-data marker keyword are used to indicate scope
+of applicability. If "1" is used in the keyword, it means that the meta-data
+should be re-sent to all ioslave of the same type. On the other hand if "0" is
+used, then the meta-data should only be re-sent to ioslaves that are not only
+of the same type but also those that are only tasked to retrieve data from the
+very same host as the one that originally sent the internal meta-data.
+
+When internal meta-data values are resent back to the ioslaves, the keyword
+used to mark them internal will be removed from the key name. Also note that
+internal meta-data are internal to KIO and are not accessiable at the application
+level.
+
 The following keys are currently in use:
 
 Key             Value(s)        Description
Index: kio/kio/job_p.h
===================================================================
--- kio/kio/job_p.h	(revision 1119700)
+++ kio/kio/job_p.h	(working copy)
@@ -55,6 +55,7 @@
         Job* m_parentJob;
         int m_extraFlags;
         MetaData m_incomingMetaData;
+        MetaData m_internalMetaData;
         MetaData m_outgoingMetaData;
 
         inline KIO::JobUiDelegate *ui() const
Index: kio/kio/job.cpp
===================================================================
--- kio/kio/job.cpp	(revision 1119700)
+++ kio/kio/job.cpp	(working copy)
@@ -588,7 +588,15 @@
 void SimpleJob::slotMetaData( const KIO::MetaData &_metaData )
 {
     Q_D(SimpleJob);
-    d->m_incomingMetaData += _metaData;
+
+    QMapIterator<QString,QString> it (_metaData);
+    while (it.hasNext()) {
+        it.next();
+        if (it.key().startsWith(QLatin1String("_kio_internal_"), Qt::CaseInsensitive))
+            d->m_internalMetaData.insert(it.key(), it.value());
+        else
+            d->m_incomingMetaData.insert(it.key(), it.value());
+    }
 }
 
 void SimpleJob::storeSSLSessionFromJob(const KUrl &redirectionURL)
Index: kio/kio/scheduler_p.h
===================================================================
--- kio/kio/scheduler_p.h	(revision 1119700)
+++ kio/kio/scheduler_p.h	(working copy)
@@ -36,6 +36,7 @@
     // remove slave from keeper
     bool removeSlave(KIO::Slave *slave);
     QList<KIO::Slave *> allSlaves() const;
+    QList<KIO::Slave *> slavesFor(const QString&) const;
 
 private:
     void scheduleGrimReaper();
@@ -146,7 +147,8 @@
     KIO::Slave *createSlave(const QString &protocol, KIO::SimpleJob *job, const KUrl &url);
     bool removeSlave (KIO::Slave *slave);
     QList<KIO::Slave *> allSlaves() const;
-    ConnectedSlaveQueue m_connectedSlaveQueue;
+    void updateSlaveConfigFor(const QString&);
+    ConnectedSlaveQueue m_connectedSlaveQueue;    
 
 private slots:
     // start max one (non-connected) job and return
Index: kio/kio/scheduler.cpp
===================================================================
--- kio/kio/scheduler.cpp	(revision 1119700)
+++ kio/kio/scheduler.cpp	(working copy)
@@ -133,6 +133,10 @@
     return m_idleSlaves.values();
 }
 
+QList<KIO::Slave *> SlaveKeeper::slavesFor(const QString& host) const
+{
+    return m_idleSlaves.values(host);
+}
 
 void SlaveKeeper::scheduleGrimReaper()
 {
@@ -570,7 +574,16 @@
     return ret;
 }
 
+void ProtoQueue::updateSlaveConfigFor(const QString& host)
+{
+    QList<Slave *> slaveList (m_slaveKeeper.slavesFor(host));
 
+    Q_FOREACH(Slave *slave, slaveList) {
+        slave->setConfig(SlaveConfig::self()->configData(slave->protocol(), host));
+    }
+}
+
+
 //private slot
 void ProtoQueue::startAJob()
 {
@@ -948,17 +961,41 @@
     }
 
     KIO::SimpleJobPrivate *const jobPriv = SimpleJobPrivate::get(job);
+
+    // Preserve all internal meta-data so they can be sent back to the
+    // ioslaves as needed...
+    const KUrl jobUrl = job->url();
+    QMapIterator<QString, QString> it (jobPriv->m_internalMetaData);
+    while (it.hasNext()) {
+        it.next();        
+        if (it.key().startsWith(QLatin1String("_kio_internal_0_"), Qt::CaseInsensitive)) {
+            SlaveConfig::self()->setConfigData(jobUrl.protocol(), jobUrl.host(), it.key().mid(16), it.value());
+        } else if (it.key().startsWith(QLatin1String("_kio_internal_1_"), Qt::CaseInsensitive)) {
+            SlaveConfig::self()->setConfigData(jobUrl.protocol(), QString(), it.key().mid(16), it.value());
+        }
+    }
+
     // make sure that we knew about the job!
     Q_ASSERT(jobPriv->m_schedSerial);
 
     ProtoQueue *pq = m_protocols.value(jobPriv->m_protocol);
     pq->removeJob(job);
     if (slave) {
+        // Reconfigure the slave that sent the original internal meta-data and
+        // all other idle slaves that are currently servi
+        if (jobPriv->m_internalMetaData.count()) {
+            kDebug(7006) << "Updating already running slaves with new configuration data";
+            slave->setConfig(SlaveConfig::self()->configData(slave->protocol(), slave->host()));
+            m_protocols.value(slave->protocol())->updateSlaveConfigFor(slave->host());
+        }
         slave->setJob(0);
         slave->disconnect(job);
     }
     jobPriv->m_schedSerial = 0; // this marks the job as unscheduled again
     jobPriv->m_slave = 0;
+    // Clear the values in the internal metadata container since they have
+    // already been taken care of above...
+    jobPriv->m_internalMetaData.clear();
 }
 
 // static
