diff options
| author | Remko Tronçon <git@el-tramo.be> | 2009-11-12 18:12:47 (GMT) |
|---|---|---|
| committer | Remko Tronçon <git@el-tramo.be> | 2009-11-12 18:12:47 (GMT) |
| commit | fdd8755e2363e8d706a3d0bdc2e71f234abdf829 (patch) | |
| tree | 470401f6f80873c4e1ce5af5cd30ab6837854d04 /Swiften/Session/BasicSessionStream.cpp | |
| parent | 6a20be61e229255f93d55f13be3346525698237a (diff) | |
| download | swift-fdd8755e2363e8d706a3d0bdc2e71f234abdf829.zip swift-fdd8755e2363e8d706a3d0bdc2e71f234abdf829.tar.bz2 | |
Refactored DNS handling.
Connections now fallback on other DNS entries upon failure,
taking into account SRV priorities.
Diffstat (limited to 'Swiften/Session/BasicSessionStream.cpp')
| -rw-r--r-- | Swiften/Session/BasicSessionStream.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Swiften/Session/BasicSessionStream.cpp b/Swiften/Session/BasicSessionStream.cpp index e0fbce7..a9a3cb0 100644 --- a/Swiften/Session/BasicSessionStream.cpp +++ b/Swiften/Session/BasicSessionStream.cpp @@ -17,27 +17,27 @@ BasicSessionStream::BasicSessionStream(boost::shared_ptr<Connection> connection, void BasicSessionStream::initialize() { xmppLayer = boost::shared_ptr<XMPPLayer>( new XMPPLayer(payloadParserFactories, payloadSerializers)); xmppLayer->onStreamStart.connect(boost::bind(&BasicSessionStream::handleStreamStartReceived, shared_from_this(), _1)); xmppLayer->onElement.connect(boost::bind(&BasicSessionStream::handleElementReceived, shared_from_this(), _1)); xmppLayer->onError.connect(boost::bind( - &BasicSessionStream::handleXMPPError, shared_from_this())); - xmppLayer->onDataRead.connect(boost::bind(&BasicSessionStream::handleDataRead, shared_from_this(), _1)); - xmppLayer->onWriteData.connect(boost::bind(&BasicSessionStream::handleDataWritten, shared_from_this(), _1)); + &BasicSessionStream::handleXMPPError, shared_from_this())); + xmppLayer->onDataRead.connect(boost::bind(&BasicSessionStream::handleDataRead, shared_from_this(), _1)); + xmppLayer->onWriteData.connect(boost::bind(&BasicSessionStream::handleDataWritten, shared_from_this(), _1)); connection->onDisconnected.connect(boost::bind(&BasicSessionStream::handleConnectionError, shared_from_this(), _1)); connectionLayer = boost::shared_ptr<ConnectionLayer>( - new ConnectionLayer(connection)); + new ConnectionLayer(connection)); streamStack = new StreamStack(xmppLayer, connectionLayer); available = true; } BasicSessionStream::~BasicSessionStream() { - delete streamStack; + delete streamStack; } void BasicSessionStream::writeHeader(const ProtocolHeader& header) { assert(available); xmppLayer->writeHeader(header); } @@ -54,13 +54,13 @@ void BasicSessionStream::writeFooter() { bool BasicSessionStream::isAvailable() { return available; } bool BasicSessionStream::supportsTLSEncryption() { - return tlsLayerFactory && tlsLayerFactory->canCreate(); + return tlsLayerFactory && tlsLayerFactory->canCreate(); } void BasicSessionStream::addTLSEncryption() { assert(available); tlsLayer = tlsLayerFactory->createTLSLayer(); if (hasTLSCertificate() && !tlsLayer->setClientCertificate(getTLSCertificate())) { @@ -85,13 +85,13 @@ void BasicSessionStream::setWhitespacePingEnabled(bool enabled) { else if (whitespacePingLayer) { whitespacePingLayer->setInactive(); } } void BasicSessionStream::resetXMPPParser() { - xmppLayer->resetParser(); + xmppLayer->resetParser(); } void BasicSessionStream::handleStreamStartReceived(const ProtocolHeader& header) { onStreamStartReceived(header); } |
Swift