comparison ui/downloader.cpp @ 553:cb044efdaf0d

Debugging: Always log the complete response
author Andre Heinecke <aheinecke@intevation.de>
date Thu, 22 May 2014 08:50:28 +0000
parents 5834b340c54c
children 13cf42dbe9bd
comparison
equal deleted inserted replaced
552:fc61ef6612b0 553:cb044efdaf0d
118 return QDateTime(); 118 return QDateTime();
119 } 119 }
120 120
121 response = mSSLConnection.read(1024); 121 response = mSSLConnection.read(1024);
122 122
123 qDebug() << "Response from server was: " << response;
124
123 if (response.isNull()) { 125 if (response.isNull()) {
124 qDebug() << "No response"; 126 qDebug() << "No response";
125 emit error (tr("Connection lost"), SSLConnection::ConnectionLost); 127 emit error (tr("Connection lost"), SSLConnection::ConnectionLost);
126 return QDateTime(); 128 return QDateTime();
127 } 129 }
128 130
129 headers = parseHeaders(&response); 131 headers = parseHeaders(&response);
130 const QString lastModified = headers.value("Last-Modified"); 132 const QString lastModified = headers.value("Last-Modified");
131 qDebug() << "Headers: " << headers;
132 if (!lastModified.isEmpty()) { 133 if (!lastModified.isEmpty()) {
133 QDateTime candidate = cLocale.toDateTime(lastModified, 134 QDateTime candidate = cLocale.toDateTime(lastModified,
134 "ddd, dd MMM yyyy HH:mm:ss' GMT'"); 135 "ddd, dd MMM yyyy HH:mm:ss' GMT'");
135 if (candidate.isValid()) { 136 if (candidate.isValid()) {
136 return candidate; 137 return candidate;
137 } 138 }
138 } 139 }
139 emit error (tr("Invalid response from the server"), SSLConnection::InvalidResponse); 140 emit error (tr("Invalid response from the server"), SSLConnection::InvalidResponse);
140 qDebug() << "Response from server was: " << response;
141 return QDateTime(); 141 return QDateTime();
142 } 142 }
143 143
144 bool Downloader::downloadFile(const QString &resource, 144 bool Downloader::downloadFile(const QString &resource,
145 const QString &fileName, 145 const QString &fileName,

http://wald.intevation.org/projects/trustbridge/