diff options
author | Tobias Markmann <tm@ayena.de> | 2012-03-20 00:05:55 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2012-03-20 19:13:43 (GMT) |
commit | 3d6694b0c698fff63d11f8bb4aa995c1df882315 (patch) | |
tree | a46ccace647f23a65100cf69c951345aa6dea7ab /Swiften/Session/BOSHSessionStream.cpp | |
parent | 3d27d98ccc232ae7bfacfd5a3f85f44b6c2e9cc9 (diff) | |
download | swift-contrib-3d6694b0c698fff63d11f8bb4aa995c1df882315.zip swift-contrib-3d6694b0c698fff63d11f8bb4aa995c1df882315.tar.bz2 |
boost::shared_ptr<?>(new ?(...)) -> boost::make_shared<?>(...) transformation where possible.
License: This patch is BSD-licensed, see http://www.opensource.org/licenses/bsd-license.php
Diffstat (limited to 'Swiften/Session/BOSHSessionStream.cpp')
-rw-r--r-- | Swiften/Session/BOSHSessionStream.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Swiften/Session/BOSHSessionStream.cpp b/Swiften/Session/BOSHSessionStream.cpp index d706d43..ce5df35 100644 --- a/Swiften/Session/BOSHSessionStream.cpp +++ b/Swiften/Session/BOSHSessionStream.cpp @@ -131,71 +131,71 @@ Certificate::ref BOSHSessionStream::getPeerCertificate() const { boost::shared_ptr<CertificateVerificationError> BOSHSessionStream::getPeerCertificateVerificationError() const { return boost::shared_ptr<CertificateVerificationError>(); } ByteArray BOSHSessionStream::getTLSFinishMessage() const { return ByteArray(); } bool BOSHSessionStream::supportsZLibCompression() { return false; } void BOSHSessionStream::addZLibCompression() { } void BOSHSessionStream::setWhitespacePingEnabled(bool /*enabled*/) { return; } void BOSHSessionStream::resetXMPPParser() { xmppLayer->resetParser(); } void BOSHSessionStream::handleStreamStartReceived(const ProtocolHeader& header) { onStreamStartReceived(header); } void BOSHSessionStream::handleElementReceived(boost::shared_ptr<Element> element) { onElementReceived(element); } void BOSHSessionStream::handleXMPPError() { available = false; - onClosed(boost::shared_ptr<Error>(new Error(Error::ParseError))); + onClosed(boost::make_shared<Error>(Error::ParseError)); } void BOSHSessionStream::handlePoolSessionStarted() { fakeStreamHeaderReceipt(); } void BOSHSessionStream::handlePoolSessionTerminated(BOSHError::ref error) { eventLoop->postEvent(boost::bind(&BOSHSessionStream::fakeStreamFooterReceipt, this, error), shared_from_this()); } void BOSHSessionStream::writeHeader(const ProtocolHeader& header) { streamHeader = header; /*First time we're told to do this, don't (the sending of the initial header is handled on connect) On subsequent requests we should restart the stream the BOSH way. */ if (!firstHeader) { eventLoop->postEvent(boost::bind(&BOSHSessionStream::fakeStreamHeaderReceipt, this), shared_from_this()); eventLoop->postEvent(boost::bind(&BOSHConnectionPool::restartStream, connectionPool), shared_from_this()); } firstHeader = false; } void BOSHSessionStream::fakeStreamHeaderReceipt() { std::stringstream header; header << "<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' from='"; header << streamHeader.getTo() << "' id='dummy' version='1.0'>"; xmppLayer->handleDataRead(createSafeByteArray(header.str())); } void BOSHSessionStream::fakeStreamFooterReceipt(BOSHError::ref error) { std::string footer("</stream:stream>"); xmppLayer->handleDataRead(createSafeByteArray(footer)); onClosed(error); |