From d0db9c289fe93c3c6a9f88bcd9463d95e50e1426 Mon Sep 17 00:00:00 2001 From: orignal Date: Wed, 5 Apr 2017 17:03:32 -0400 Subject: [PATCH] fixed build errors --- i2pd | 2 +- src/i2p.cpp | 12 ++++++------ src/i2p.h | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/i2pd b/i2pd index 4448884..abf0f5a 160000 --- a/i2pd +++ b/i2pd @@ -1 +1 @@ -Subproject commit 4448884a3ebf822ecca7b39f2fe9777a79ae1863 +Subproject commit abf0f5ac8780c9cb0088e4ccefcd0d0274e63965 diff --git a/src/i2p.cpp b/src/i2p.cpp index ef0a064..cc5af80 100644 --- a/src/i2p.cpp +++ b/src/i2p.cpp @@ -13,7 +13,7 @@ namespace SAM class StreamSessionAdapter::SessionHolder { public: - explicit SessionHolder(std::auto_ptr session); + explicit SessionHolder(std::shared_ptr session); const SAM::StreamSession& getSession() const; SAM::StreamSession& getSession(); @@ -21,12 +21,12 @@ private: void heal() const; void reborn() const; - mutable std::auto_ptr session_; + mutable std::shared_ptr session_; typedef boost::shared_mutex mutex_type; mutable mutex_type mtx_; }; -StreamSessionAdapter::SessionHolder::SessionHolder(std::auto_ptr session) +StreamSessionAdapter::SessionHolder::SessionHolder(std::shared_ptr session) : session_(session) {} @@ -61,7 +61,7 @@ void StreamSessionAdapter::SessionHolder::reborn() const { if (!session_->isSick()) return; - std::auto_ptr newSession(new SAM::StreamSession(*session_)); + std::shared_ptr newSession(new SAM::StreamSession(*session_)); if (!newSession->isSick() && session_->isSick()) session_ = newSession; } @@ -87,14 +87,14 @@ StreamSessionAdapter::~StreamSessionAdapter() SAM::SOCKET StreamSessionAdapter::accept(bool silent) { - SAM::RequestResult > result = sessionHolder_->getSession().accept(silent); + SAM::RequestResult > result = sessionHolder_->getSession().accept(silent); // call Socket::release return result.isOk ? result.value->release() : SAM_INVALID_SOCKET; } SAM::SOCKET StreamSessionAdapter::connect(const std::string& destination, bool silent) { - SAM::RequestResult > result = sessionHolder_->getSession().connect(destination, silent); + SAM::RequestResult > result = sessionHolder_->getSession().connect(destination, silent); // call Socket::release return result.isOk ? result.value->release() : SAM_INVALID_SOCKET; } diff --git a/src/i2p.h b/src/i2p.h index 0405b1d..eb52bc3 100644 --- a/src/i2p.h +++ b/src/i2p.h @@ -67,7 +67,7 @@ public: private: class SessionHolder; - std::auto_ptr sessionHolder_; + std::shared_ptr sessionHolder_; }; } // namespace SAM