diff options
| author | Jeremy Lainé <jeremy.laine@m4x.org> | 2015-08-17 10:32:56 +0200 |
|---|---|---|
| committer | Jeremy Lainé <jeremy.laine@m4x.org> | 2015-08-17 10:32:56 +0200 |
| commit | 445fce6c3c4b72e960bc66da743ebdcab3db786c (patch) | |
| tree | 3a61ee5eb4e0ab66e55dd272d4351ff5b92f2044 /src/base | |
| parent | 4c8d5fdded36e1a57840e0c9d499e75213952f7d (diff) | |
| download | qxmpp-445fce6c3c4b72e960bc66da743ebdcab3db786c.tar.gz | |
ICE candidate foundation can be an arbitrary string
Diffstat (limited to 'src/base')
| -rw-r--r-- | src/base/QXmppJingleIq.cpp | 9 | ||||
| -rw-r--r-- | src/base/QXmppJingleIq.h | 6 | ||||
| -rw-r--r-- | src/base/QXmppStun.cpp | 2 |
3 files changed, 8 insertions, 9 deletions
diff --git a/src/base/QXmppJingleIq.cpp b/src/base/QXmppJingleIq.cpp index 001ea3c3..ee6ccc23 100644 --- a/src/base/QXmppJingleIq.cpp +++ b/src/base/QXmppJingleIq.cpp @@ -431,7 +431,6 @@ void QXmppJingleIq::toXmlElementFromChild(QXmlStreamWriter *writer) const QXmppJingleCandidate::QXmppJingleCandidate() : m_component(0), - m_foundation(0), m_generation(0), m_network(0), m_port(0), @@ -458,7 +457,7 @@ void QXmppJingleCandidate::setComponent(int component) /// Returns the candidate's foundation. -int QXmppJingleCandidate::foundation() const +QString QXmppJingleCandidate::foundation() const { return m_foundation; } @@ -467,7 +466,7 @@ int QXmppJingleCandidate::foundation() const /// /// \param foundation -void QXmppJingleCandidate::setFoundation(int foundation) +void QXmppJingleCandidate::setFoundation(const QString &foundation) { m_foundation = foundation; } @@ -603,7 +602,7 @@ bool QXmppJingleCandidate::isNull() const void QXmppJingleCandidate::parse(const QDomElement &element) { m_component = element.attribute("component").toInt(); - m_foundation = element.attribute("foundation").toInt(); + m_foundation = element.attribute("foundation"); m_generation = element.attribute("generation").toInt(); m_host = QHostAddress(element.attribute("ip")); m_id = element.attribute("id"); @@ -618,7 +617,7 @@ void QXmppJingleCandidate::toXml(QXmlStreamWriter *writer) const { writer->writeStartElement("candidate"); helperToXmlAddAttribute(writer, "component", QString::number(m_component)); - helperToXmlAddAttribute(writer, "foundation", QString::number(m_foundation)); + helperToXmlAddAttribute(writer, "foundation", m_foundation); helperToXmlAddAttribute(writer, "generation", QString::number(m_generation)); helperToXmlAddAttribute(writer, "id", m_id); helperToXmlAddAttribute(writer, "ip", m_host.toString()); diff --git a/src/base/QXmppJingleIq.h b/src/base/QXmppJingleIq.h index 34c0bcef..7dc68d32 100644 --- a/src/base/QXmppJingleIq.h +++ b/src/base/QXmppJingleIq.h @@ -99,8 +99,8 @@ public: int component() const; void setComponent(int component); - int foundation() const; - void setFoundation(int foundation); + QString foundation() const; + void setFoundation(const QString &foundation); QHostAddress host() const; void setHost(const QHostAddress &host); @@ -135,7 +135,7 @@ public: private: int m_component; - int m_foundation; + QString m_foundation; int m_generation; QHostAddress m_host; QString m_id; diff --git a/src/base/QXmppStun.cpp b/src/base/QXmppStun.cpp index fe88cd38..0fd49195 100644 --- a/src/base/QXmppStun.cpp +++ b/src/base/QXmppStun.cpp @@ -1880,7 +1880,7 @@ void QXmppIceComponent::setSockets(QList<QUdpSocket*> sockets) QXmppJingleCandidate candidate; candidate.setComponent(m_component); - candidate.setFoundation(foundation++); + candidate.setFoundation(QString::number(foundation++)); // remove scope ID from IPv6 non-link local addresses QHostAddress addr(socket->localAddress()); if (addr.protocol() == QAbstractSocket::IPv6Protocol && |
