QNetworkAccessManager: fixed foreach copy of host address
Change-Id: I50cb113fb3c803fc5b13c74b3f7ad1fc4283065b Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
This commit is contained in:
parent
755fe9da1d
commit
08845d3531
@ -976,7 +976,7 @@ void QHttpNetworkConnectionPrivate::_q_hostLookupFinished(QHostInfo info)
|
|||||||
bool bIpv6 = false;
|
bool bIpv6 = false;
|
||||||
bool foundAddress = false;
|
bool foundAddress = false;
|
||||||
|
|
||||||
foreach (QHostAddress address, info.addresses()) {
|
foreach (const QHostAddress &address, info.addresses()) {
|
||||||
if (address.protocol() == QAbstractSocket::IPv4Protocol) {
|
if (address.protocol() == QAbstractSocket::IPv4Protocol) {
|
||||||
if (!foundAddress) {
|
if (!foundAddress) {
|
||||||
foundAddress = true;
|
foundAddress = true;
|
||||||
|
@ -952,7 +952,7 @@ void QAbstractSocketPrivate::_q_startConnecting(const QHostInfo &hostInfo)
|
|||||||
if (preferredNetworkLayerProtocol == QAbstractSocket::UnknownNetworkLayerProtocol || preferredNetworkLayerProtocol == QAbstractSocket::AnyIPProtocol) {
|
if (preferredNetworkLayerProtocol == QAbstractSocket::UnknownNetworkLayerProtocol || preferredNetworkLayerProtocol == QAbstractSocket::AnyIPProtocol) {
|
||||||
addresses = hostInfo.addresses();
|
addresses = hostInfo.addresses();
|
||||||
} else {
|
} else {
|
||||||
foreach (QHostAddress address, hostInfo.addresses())
|
foreach (const QHostAddress &address, hostInfo.addresses())
|
||||||
if (address.protocol() == preferredNetworkLayerProtocol)
|
if (address.protocol() == preferredNetworkLayerProtocol)
|
||||||
addresses += address;
|
addresses += address;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user