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 foundAddress = false;
|
||||
|
||||
foreach (QHostAddress address, info.addresses()) {
|
||||
foreach (const QHostAddress &address, info.addresses()) {
|
||||
if (address.protocol() == QAbstractSocket::IPv4Protocol) {
|
||||
if (!foundAddress) {
|
||||
foundAddress = true;
|
||||
|
@ -952,7 +952,7 @@ void QAbstractSocketPrivate::_q_startConnecting(const QHostInfo &hostInfo)
|
||||
if (preferredNetworkLayerProtocol == QAbstractSocket::UnknownNetworkLayerProtocol || preferredNetworkLayerProtocol == QAbstractSocket::AnyIPProtocol) {
|
||||
addresses = hostInfo.addresses();
|
||||
} else {
|
||||
foreach (QHostAddress address, hostInfo.addresses())
|
||||
foreach (const QHostAddress &address, hostInfo.addresses())
|
||||
if (address.protocol() == preferredNetworkLayerProtocol)
|
||||
addresses += address;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user