summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2014-02-11 15:12:00 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-02-11 15:12:00 +0100
commitdf62c31807f7b0a8b9bc222b47ccc7016cfaee65 (patch)
treea7df6263cdb4cc96e2d31486437ec19ca0bf01e5 /src/network
parent17de86f2824c1807c0fa7fa7ae0ed3b7d2acca00 (diff)
parenta1fe728fa5bd6cb9e50cf317a58efcf4eea4de2c (diff)
Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev
Diffstat (limited to 'src/network')
-rw-r--r--src/network/access/qnetworkaccessmanager.cpp7
-rw-r--r--src/network/access/qnetworkdiskcache.cpp14
-rw-r--r--src/network/access/qnetworkreplyfileimpl.cpp6
-rw-r--r--src/network/kernel/qdnslookup_unix.cpp2
-rw-r--r--src/network/kernel/qhostinfo_unix.cpp2
-rw-r--r--src/network/socket/qabstractsocket.cpp2
6 files changed, 24 insertions, 9 deletions
diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp
index 980b19b7e4..c89419091f 100644
--- a/src/network/access/qnetworkaccessmanager.cpp
+++ b/src/network/access/qnetworkaccessmanager.cpp
@@ -224,12 +224,7 @@ static void ensureInitialized()
\note The network and roaming support in QNetworkAccessManager is conditional
upon the platform supporting connection management. The
\l QNetworkConfigurationManager::NetworkSessionRequired can be used to
- detect whether QNetworkAccessManager utilizes this feature. Currently only
- Meego/Harmattan platforms provide connection management support.
-
- \note This feature cannot be used in combination with the Bearer Management
- API as provided by QtMobility. Applications have to migrate to the Qt version
- of Bearer Management.
+ detect whether QNetworkAccessManager utilizes this feature.
\sa QNetworkRequest, QNetworkReply, QNetworkProxy
*/
diff --git a/src/network/access/qnetworkdiskcache.cpp b/src/network/access/qnetworkdiskcache.cpp
index d64d697013..2f2d1ab9a9 100644
--- a/src/network/access/qnetworkdiskcache.cpp
+++ b/src/network/access/qnetworkdiskcache.cpp
@@ -559,6 +559,20 @@ qint64 QNetworkDiskCache::expire()
break;
QString name = i.value();
QFile file(name);
+
+ if (name.contains(PREPARED_SLASH)) {
+ QHashIterator<QIODevice*, QCacheItem*> iterator(d->inserting);
+ while (iterator.hasNext()) {
+ iterator.next();
+ QCacheItem *item = iterator.value();
+ if (item && item->file && item->file->fileName() == name) {
+ delete item->file;
+ item->file = 0;
+ break;
+ }
+ }
+ }
+
qint64 size = file.size();
file.remove();
totalSize -= size;
diff --git a/src/network/access/qnetworkreplyfileimpl.cpp b/src/network/access/qnetworkreplyfileimpl.cpp
index f7555f8fc3..2724a54309 100644
--- a/src/network/access/qnetworkreplyfileimpl.cpp
+++ b/src/network/access/qnetworkreplyfileimpl.cpp
@@ -161,6 +161,8 @@ void QNetworkReplyFileImpl::abort()
qint64 QNetworkReplyFileImpl::bytesAvailable() const
{
Q_D(const QNetworkReplyFileImpl);
+ if (!d->realFile.isOpen())
+ return QNetworkReply::bytesAvailable();
return QNetworkReply::bytesAvailable() + d->realFile.bytesAvailable();
}
@@ -181,7 +183,11 @@ qint64 QNetworkReplyFileImpl::size() const
qint64 QNetworkReplyFileImpl::readData(char *data, qint64 maxlen)
{
Q_D(QNetworkReplyFileImpl);
+ if (!d->realFile.isOpen())
+ return -1;
qint64 ret = d->realFile.read(data, maxlen);
+ if (bytesAvailable() == 0 && d->realFile.isOpen())
+ d->realFile.close();
if (ret == 0 && bytesAvailable() == 0)
return -1;
else
diff --git a/src/network/kernel/qdnslookup_unix.cpp b/src/network/kernel/qdnslookup_unix.cpp
index 052c492f07..9fb488cee6 100644
--- a/src/network/kernel/qdnslookup_unix.cpp
+++ b/src/network/kernel/qdnslookup_unix.cpp
@@ -52,7 +52,7 @@
#include <arpa/nameser_compat.h>
#include <resolv.h>
-#ifdef __GNU_LIBRARY__
+#if defined(__GNU_LIBRARY__) && !defined(__UCLIBC__)
# include <gnu/lib-names.h>
#endif
diff --git a/src/network/kernel/qhostinfo_unix.cpp b/src/network/kernel/qhostinfo_unix.cpp
index 9c7712800d..df8c8b145a 100644
--- a/src/network/kernel/qhostinfo_unix.cpp
+++ b/src/network/kernel/qhostinfo_unix.cpp
@@ -63,7 +63,7 @@
# include <resolv.h>
#endif
-#ifdef __GNU_LIBRARY__
+#if defined(__GNU_LIBRARY__) && !defined(__UCLIBC__)
# include <gnu/lib-names.h>
#endif
diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp
index 1906166257..0345537d1c 100644
--- a/src/network/socket/qabstractsocket.cpp
+++ b/src/network/socket/qabstractsocket.cpp
@@ -2221,7 +2221,7 @@ bool QAbstractSocket::waitForBytesWritten(int msecs)
if (readyToWrite) {
if (d->canWriteNotification()) {
#if defined (QABSTRACTSOCKET_DEBUG)
- qDebug("QAbstractSocket::waitForBytesWritten returns \c true");
+ qDebug("QAbstractSocket::waitForBytesWritten returns true");
#endif
return true;
}