diff options
| author | Kevin Smith <git@kismith.co.uk> | 2011-11-12 16:56:21 (GMT) |
|---|---|---|
| committer | Kevin Smith <git@kismith.co.uk> | 2011-12-13 08:17:58 (GMT) |
| commit | 81c09a0f6a3e87b078340d7f35d0dea4c03f3a6d (patch) | |
| tree | 4371c5808ee26b2b5ed79ace9ccb439ff2988945 /Swiften/Session/BasicSessionStream.cpp | |
| parent | fd17fe0d239f97cedebe4ceffa234155bd299b68 (diff) | |
| download | swift-contrib-81c09a0f6a3e87b078340d7f35d0dea4c03f3a6d.zip swift-contrib-81c09a0f6a3e87b078340d7f35d0dea4c03f3a6d.tar.bz2 | |
BOSH Support for Swiften
This adds support for BOSH to Swiften. It does not expose it to Swift.
Release-Notes: Swiften now allows connects over BOSH, if used appropriately.
Diffstat (limited to 'Swiften/Session/BasicSessionStream.cpp')
| -rw-r--r-- | Swiften/Session/BasicSessionStream.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Swiften/Session/BasicSessionStream.cpp b/Swiften/Session/BasicSessionStream.cpp index 07a04b8..70bbeea 100644 --- a/Swiften/Session/BasicSessionStream.cpp +++ b/Swiften/Session/BasicSessionStream.cpp @@ -104,70 +104,74 @@ bool BasicSessionStream::isOpen() { bool BasicSessionStream::supportsTLSEncryption() { return tlsContextFactory && tlsContextFactory->canCreate(); } void BasicSessionStream::addTLSEncryption() { assert(available); tlsLayer = new TLSLayer(tlsContextFactory); if (hasTLSCertificate() && !tlsLayer->setClientCertificate(getTLSCertificate())) { onClosed(boost::shared_ptr<Error>(new Error(Error::InvalidTLSCertificateError))); } else { streamStack->addLayer(tlsLayer); tlsLayer->onError.connect(boost::bind(&BasicSessionStream::handleTLSError, this)); tlsLayer->onConnected.connect(boost::bind(&BasicSessionStream::handleTLSConnected, this)); tlsLayer->connect(); } } bool BasicSessionStream::isTLSEncrypted() { return tlsLayer; } Certificate::ref BasicSessionStream::getPeerCertificate() const { return tlsLayer->getPeerCertificate(); } boost::shared_ptr<CertificateVerificationError> BasicSessionStream::getPeerCertificateVerificationError() const { return tlsLayer->getPeerCertificateVerificationError(); } ByteArray BasicSessionStream::getTLSFinishMessage() const { return tlsLayer->getContext()->getFinishMessage(); } +bool BasicSessionStream::supportsZLibCompression() { + return true; +} + void BasicSessionStream::addZLibCompression() { compressionLayer = new CompressionLayer(); streamStack->addLayer(compressionLayer); } void BasicSessionStream::setWhitespacePingEnabled(bool enabled) { if (enabled) { if (!whitespacePingLayer) { whitespacePingLayer = new WhitespacePingLayer(timerFactory); streamStack->addLayer(whitespacePingLayer); } whitespacePingLayer->setActive(); } else if (whitespacePingLayer) { whitespacePingLayer->setInactive(); } } void BasicSessionStream::resetXMPPParser() { xmppLayer->resetParser(); } void BasicSessionStream::handleStreamStartReceived(const ProtocolHeader& header) { onStreamStartReceived(header); } void BasicSessionStream::handleElementReceived(boost::shared_ptr<Element> element) { onElementReceived(element); } void BasicSessionStream::handleXMPPError() { available = false; onClosed(boost::shared_ptr<Error>(new Error(Error::ParseError))); } |
Swift