+2007-10-25 Holger Freyther <zecke@selfish.org>
+
+ Reviewed by Simon Hausmann <hausmann@kde.org>.
+
+ * fast/dom/onerror-img.html regressed due checking the JobStates because in case of error (e.g. not being able to connect) the job will no be started.
+ * Use the error message from Qt. It might or might not be translated.
+
+
+ WARNING: NO TEST CASES ADDED OR CHANGED
+
+ * platform/network/qt/ResourceHandleQt.cpp:
+ (WebCore::WebCoreSynchronousLoader::didFail):
+
2007-10-25 Holger Freyther <zecke@selfish.org>
Reviewed by Simon Hausmann <hausmann@kde.org>.
void WebCoreSynchronousLoader::didFail(ResourceHandle*, const ResourceError& error)
{
m_error = error;
+ m_finished = true;
}
void WebCoreSynchronousLoader::waitForCompletion()
return d->response;
}
+/*!
+ The last error of the Job.
+*/
+QString QWebNetworkJob::errorString() const
+{
+ return d->errorString;
+}
+
/*!
Sets the HTTP reponse header. The response header has to be called before
emitting QWebNetworkInterface::started.
d->response = response;
}
+void QWebNetworkJob::setErrorString(const QString& errorString)
+{
+ d->errorString = errorString;
+}
+
/*!
returns true if the job has been cancelled by the WebKit framework
*/
void QWebNetworkManager::finished(QWebNetworkJob *job, int errorCode)
{
- Q_ASSERT(job->status() == QWebNetworkJob::JobStarted ||
+ Q_ASSERT(errorCode == 1 ||
+ job->status() == QWebNetworkJob::JobStarted ||
job->status() == QWebNetworkJob::JobReceivingData);
if (m_synchronousJobs.contains(job))
//FIXME: error setting error was removed from ResourceHandle
client->didFail(job->d->resourceHandle,
ResourceError(job->d->request.url.host(), job->d->response.statusCode(),
- job->d->request.url.toString(), String()));
+ job->d->request.url.toString(), job->d->errorString));
} else {
client->didFinishLoading(job->d->resourceHandle);
}
continue;
// This job was not yet started... we have no idea if data comes by...
- if (static_cast<int>(jobFinished->job->status()) < QWebNetworkJob::JobStarted)
+ // and it won't start in case of errors
+ if (static_cast<int>(jobFinished->job->status()) < QWebNetworkJob::JobStarted && jobFinished->errorCode != 1)
continue;
m_queueMutex.lock();
QHttp *http = connection[c].http;
DEBUG() << "WebCoreHttp::slotFinished connection=" << c << error << job;
- if (error)
+ if (error) {
DEBUG() << " error: " << http->errorString();
+ job->setErrorString(http->errorString());
+ }
if (!error && http->bytesAvailable()) {
QByteArray data;
QByteArray postData() const;
QHttpRequestHeader httpHeader() const;
QWebNetworkRequest request() const;
+ QString errorString() const;
QHttpResponseHeader response() const;
void setResponse(const QHttpResponseHeader &response);
+ void setErrorString(const QString&);
bool cancelled() const;
QWebNetworkInterface *interface;
QWebObjectPluginConnector *connector;
QWebNetworkJob::JobStatus jobStatus;
+ QString errorString;
};
class QWebNetworkManager : public QObject
+2007-10-25 Holger Freyther <zecke@selfish.org>
+
+ Reviewed by Simon Hausmann <hausmann@kde.org>.
+
+ * fast/dom/onerror-img.html regressed due checking the JobStates because in case of error (e.g. not being able to connect) the job will no be started.
+ * Use the error message from Qt. It might or might not be translated.
+
+
+ * Api/qwebnetworkinterface.cpp:
+ (QWebNetworkJob::errorString):
+ (QWebNetworkJob::setErrorString):
+ (QWebNetworkManager::finished):
+ (QWebNetworkManager::doWork):
+ (WebCoreHttp::onRequestFinished):
+ * Api/qwebnetworkinterface.h:
+ * Api/qwebnetworkinterface_p.h:
+
2007-10-25 Holger Freyther <zecke@selfish.org>
Reviewed by Simon Hausmann <hausmann@kde.org>.