diff options
| author | Jeremy Lainé <jeremy.laine@m4x.org> | 2011-02-03 16:04:13 +0000 |
|---|---|---|
| committer | Jeremy Lainé <jeremy.laine@m4x.org> | 2011-02-03 16:04:13 +0000 |
| commit | 157327f910fea252d7b8034ffaf6eaedeae68a0c (patch) | |
| tree | 9e75353821d38caaa8b359aebc886498cf5cc8dc /src | |
| parent | f3c9b7bedfa7514e2f6454cd6a32ae45b44054ad (diff) | |
| download | qxmpp-157327f910fea252d7b8034ffaf6eaedeae68a0c.tar.gz | |
QXmppIceConnection::setStunServer() should not perform DNS queries
(no impact as it is currently unused, but for future API compatibility)
Diffstat (limited to 'src')
| -rw-r--r-- | src/QXmppStun.cpp | 24 | ||||
| -rw-r--r-- | src/QXmppStun.h | 2 |
2 files changed, 4 insertions, 22 deletions
diff --git a/src/QXmppStun.cpp b/src/QXmppStun.cpp index 90129592..4a859dc2 100644 --- a/src/QXmppStun.cpp +++ b/src/QXmppStun.cpp @@ -1545,29 +1545,11 @@ void QXmppIceConnection::setRemotePassword(const QString &password) /// Sets the STUN server to use to determine server-reflexive addresses /// and ports. /// -/// \param hostName The host name or address of the STUN server. -/// \param port The port of the STUN server. +/// \param host The address of the STUN server. +/// \param port The port of the STUN server. -void QXmppIceConnection::setStunServer(const QString &hostName, quint16 port) +void QXmppIceConnection::setStunServer(const QHostAddress &host, quint16 port) { - // lookup STUN server - QHostAddress host; - QHostInfo hostInfo = QHostInfo::fromName(hostName); - foreach (const QHostAddress &address, hostInfo.addresses()) - { - if (address.protocol() == QAbstractSocket::IPv4Protocol) - { - host = address; - break; - } - } - if (host.isNull()) - { - warning(QString("Could not lookup STUN server %1").arg(hostName)); - return; - } - - // store STUN server m_stunHost = host; m_stunPort = port; foreach (QXmppIceComponent *socket, m_components.values()) diff --git a/src/QXmppStun.h b/src/QXmppStun.h index 6b15b2ad..0ad82032 100644 --- a/src/QXmppStun.h +++ b/src/QXmppStun.h @@ -223,7 +223,7 @@ public: void setRemoteUser(const QString &user); void setRemotePassword(const QString &password); - void setStunServer(const QString &hostName, quint16 port = 3478); + void setStunServer(const QHostAddress &host, quint16 port = 3478); bool bind(const QList<QHostAddress> &addresses); bool isConnected() const; |
