From 228e2d78292326f2702cba33b1cb32bd6de6cdc9 Mon Sep 17 00:00:00 2001 From: Dmytro Bogovych Date: Tue, 4 Jun 2019 15:30:53 +0300 Subject: [PATCH] - switch to unique_ptr - add initial CI --- .gitlab-ci.yml | 7 ++++ src/engine/endpoint/EP_Account.cpp | 2 +- src/engine/endpoint/EP_Engine.cpp | 2 +- src/engine/endpoint/EP_Engine.h | 2 +- src/libs/resiprocate/p2p/BatchMessages.hxx | 2 +- src/libs/resiprocate/p2p/ChordTopology.hxx | 2 +- src/libs/resiprocate/p2p/Connect.hxx | 4 +-- src/libs/resiprocate/p2p/Dispatcher.hxx | 4 +-- src/libs/resiprocate/p2p/EventWrapper.hxx | 6 ++-- src/libs/resiprocate/p2p/FetchAns.hxx | 2 +- src/libs/resiprocate/p2p/FetchReq.hxx | 2 +- src/libs/resiprocate/p2p/ForwardingLayer.hxx | 4 +-- src/libs/resiprocate/p2p/Join.hxx | 4 +-- src/libs/resiprocate/p2p/Leave.hxx | 4 +-- src/libs/resiprocate/p2p/Message.hxx | 2 +- src/libs/resiprocate/p2p/Postable.hxx | 2 +- .../resiprocate/p2p/SelectTransporter.hxx | 4 +-- src/libs/resiprocate/p2p/StoreAns.hxx | 2 +- src/libs/resiprocate/p2p/StoreReq.hxx | 2 +- src/libs/resiprocate/p2p/StoreSet.hxx | 4 +-- src/libs/resiprocate/p2p/Transporter.hxx | 8 ++--- .../resiprocate/p2p/TransporterMessage.hxx | 6 ++-- src/libs/resiprocate/p2p/Update.hxx | 4 +-- src/libs/resiprocate/presSvr/SubDialog.cpp | 2 +- src/libs/resiprocate/presSvr/SubDialogMgr.cpp | 2 +- src/libs/resiprocate/presSvr/TuPresSvr.cpp | 14 ++++---- .../reflow/dtls_wrapper/DtlsFactory.hxx | 8 ++--- .../reflow/dtls_wrapper/DtlsSocket.hxx | 4 +-- .../resiprocate/repro/AccountingCollector.hxx | 2 +- src/libs/resiprocate/repro/AsyncProcessor.hxx | 2 +- src/libs/resiprocate/repro/Dispatcher.hxx | 4 +-- src/libs/resiprocate/repro/ProcessorChain.hxx | 2 +- src/libs/resiprocate/repro/Proxy.hxx | 8 ++--- src/libs/resiprocate/repro/ReproRunner.hxx | 2 +- src/libs/resiprocate/repro/RequestContext.hxx | 6 ++-- .../resiprocate/repro/ResponseContext.hxx | 2 +- .../resip/dum/ClientAuthExtension.cxx | 2 +- .../resip/dum/ClientAuthExtension.hxx | 4 +-- .../resip/dum/ClientAuthManager.cxx | 2 +- .../resip/dum/ClientInviteSession.cxx | 6 ++-- .../resip/dum/ClientInviteSession.hxx | 2 +- .../resip/dum/ClientPagerMessage.cxx | 6 ++-- .../resip/dum/ClientPagerMessage.hxx | 4 +-- .../resiprocate/resip/dum/DialogEventInfo.hxx | 10 +++--- .../resip/dum/DialogUsageManager.cxx | 30 ++++++++-------- .../resip/dum/DialogUsageManager.hxx | 36 +++++++++---------- src/libs/resiprocate/resip/dum/DumFeature.cxx | 2 +- src/libs/resiprocate/resip/dum/DumFeature.hxx | 2 +- src/libs/resiprocate/resip/dum/DumThread.cxx | 2 +- .../resiprocate/resip/dum/HttpProvider.cxx | 2 +- .../resiprocate/resip/dum/HttpProvider.hxx | 4 +-- .../resiprocate/resip/dum/IdentityHandler.cxx | 2 +- .../resiprocate/resip/dum/InviteSession.cxx | 34 +++++++++--------- .../resiprocate/resip/dum/InviteSession.hxx | 20 +++++------ .../resip/dum/InviteSessionCreator.cxx | 2 +- .../resiprocate/resip/dum/OutgoingEvent.hxx | 4 +-- .../resip/dum/PagerMessageHandler.hxx | 2 +- .../resip/dum/RegistrationHandler.hxx | 6 ++-- .../resip/dum/ServerAuthManager.cxx | 2 +- .../resip/dum/ServerInviteSession.cxx | 4 +-- .../resip/dum/ServerRegistration.cxx | 10 +++--- .../resip/dum/ServerRegistration.hxx | 20 +++++------ .../resiprocate/resip/dum/TargetCommand.cxx | 6 ++-- .../resiprocate/resip/dum/TargetCommand.hxx | 6 ++-- .../resip/dum/ssl/EncryptionManager.cxx | 10 +++--- .../resip/dum/ssl/EncryptionManager.hxx | 4 +-- .../resip/recon/RemoteParticipant.hxx | 2 +- .../recon/RemoteParticipantDialogSet.hxx | 8 ++--- .../resip/stack/ConnectionBase.cxx | 4 +-- src/libs/resiprocate/resip/stack/Helper.cxx | 20 +++++------ src/libs/resiprocate/resip/stack/Helper.hxx | 10 +++--- .../resip/stack/InternalTransport.hxx | 2 +- .../resiprocate/resip/stack/SipMessage.cxx | 20 +++++------ src/libs/resiprocate/resip/stack/SipStack.cxx | 4 +-- src/libs/resiprocate/resip/stack/SipStack.hxx | 16 ++++----- .../resip/stack/TransactionState.hxx | 6 ++-- .../resiprocate/resip/stack/Transport.hxx | 8 ++--- .../resip/stack/TransportSelector.cxx | 6 ++-- .../resip/stack/TransportSelector.hxx | 6 ++-- .../resip/stack/TransportSelectorThread.hxx | 2 +- .../resip/stack/TransportThread.hxx | 2 +- .../resiprocate/resip/stack/UdpTransport.cxx | 10 +++--- .../resiprocate/resip/stack/UdpTransport.hxx | 2 +- .../resiprocate/resip/stack/ssl/Security.cxx | 2 +- src/libs/resiprocate/rutil/SharedCount.hxx | 6 ++-- src/libs/resiprocate/rutil/SharedPtr.hxx | 6 ++-- src/libs/resiprocate/rutil/dns/DnsThread.hxx | 2 +- src/libs/resiprocate/rutil/ssl/SHA1Stream.hxx | 2 +- 88 files changed, 269 insertions(+), 262 deletions(-) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 00000000..86e19d9a --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,7 @@ +build_exe: + script: + - mkdir -p build + - cd build + - cmake ../src + - cmake --build . + \ No newline at end of file diff --git a/src/engine/endpoint/EP_Account.cpp b/src/engine/endpoint/EP_Account.cpp index 33660629..115e0111 100644 --- a/src/engine/endpoint/EP_Account.cpp +++ b/src/engine/endpoint/EP_Account.cpp @@ -416,7 +416,7 @@ int Account::sendMsg(const std::string& peer, const void* ptr, unsigned length, resip::ClientPagerMessageHandle msgHandle = mAgent.mDum->makePagerMessage(resip::NameAddr(resip::Data(peer)), mProfile, s); unique_ptr contentPtr(new resip::PlainContents(resip::Data(std::string((const char*)ptr, length)),type)); int result = s->sessionId(); - msgHandle->page(contentPtr); + msgHandle->page(std::move(contentPtr)); return result; } diff --git a/src/engine/endpoint/EP_Engine.cpp b/src/engine/endpoint/EP_Engine.cpp index 6c16a852..6ca93e14 100644 --- a/src/engine/endpoint/EP_Engine.cpp +++ b/src/engine/endpoint/EP_Engine.cpp @@ -245,7 +245,7 @@ void UserAgent::start() mDum->setServerPagerMessageHandler(this); unique_ptr uac_dsf(new ResipSessionFactory(this)); - mDum->setAppDialogSetFactory(uac_dsf); + mDum->setAppDialogSetFactory(std::move(uac_dsf)); // Fire onStart event if stun is not used or stun server ip is known if (mConfig[CONFIG_STUNSERVER_NAME].asStdString().empty() || !mConfig[CONFIG_STUNSERVER_IP].asStdString().empty()) diff --git a/src/engine/endpoint/EP_Engine.h b/src/engine/endpoint/EP_Engine.h index 0661d374..fde22efd 100644 --- a/src/engine/endpoint/EP_Engine.h +++ b/src/engine/endpoint/EP_Engine.h @@ -429,7 +429,7 @@ public: #pragma region PagerHandler void onSuccess(resip::ClientPagerMessageHandle, const resip::SipMessage& status) override; - void onFailure(resip::ClientPagerMessageHandle, const resip::SipMessage& status, std::auto_ptr contents) override; + void onFailure(resip::ClientPagerMessageHandle, const resip::SipMessage& status, std::unique_ptr contents) override; void onMessageArrived(resip::ServerPagerMessageHandle, const resip::SipMessage& message) override; #pragma endregion diff --git a/src/libs/resiprocate/p2p/BatchMessages.hxx b/src/libs/resiprocate/p2p/BatchMessages.hxx index 1568ca28..13fa60d7 100644 --- a/src/libs/resiprocate/p2p/BatchMessages.hxx +++ b/src/libs/resiprocate/p2p/BatchMessages.hxx @@ -16,7 +16,7 @@ class Message; class BatchMessages : public EventConsumerBase, public Event { BatchMessages(Dispatcher& dispatcher, - std::vector >& messages, + std::vector >& messages, Postable& postable); virtual ~BatchMessages() = 0; diff --git a/src/libs/resiprocate/p2p/ChordTopology.hxx b/src/libs/resiprocate/p2p/ChordTopology.hxx index d0edc473..e8cd7e61 100644 --- a/src/libs/resiprocate/p2p/ChordTopology.hxx +++ b/src/libs/resiprocate/p2p/ChordTopology.hxx @@ -69,7 +69,7 @@ class ChordTopology : public TopologyAPI virtual ResourceId resourceId( const resip::Data& resourceName ); // not public api - virtual void post(std::auto_ptr message); + virtual void post(std::unique_ptr message); private: diff --git a/src/libs/resiprocate/p2p/Connect.hxx b/src/libs/resiprocate/p2p/Connect.hxx index 789df93b..7e63ff2f 100644 --- a/src/libs/resiprocate/p2p/Connect.hxx +++ b/src/libs/resiprocate/p2p/Connect.hxx @@ -14,7 +14,7 @@ public: virtual MessageType getType() const { return ConnectReqType; } virtual resip::Data brief() const { return "ConnectReq Message"; } - std::auto_ptr event() + std::unique_ptr event() { return wrap(this); } @@ -32,7 +32,7 @@ public: virtual MessageType getType() const { return ConnectAnsType; } virtual resip::Data brief() const { return "ConnectAns Message"; } - std::auto_ptr event() + std::unique_ptr event() { return wrap(this); } diff --git a/src/libs/resiprocate/p2p/Dispatcher.hxx b/src/libs/resiprocate/p2p/Dispatcher.hxx index 30f83151..f0209cac 100644 --- a/src/libs/resiprocate/p2p/Dispatcher.hxx +++ b/src/libs/resiprocate/p2p/Dispatcher.hxx @@ -19,10 +19,10 @@ class Dispatcher : public Postable void init(ForwardingLayer& forwardingLayer); void registerPostable(Message::MessageType type, Postable& postable); - void send(std::auto_ptr message, Postable& responseSink); + void send(std::unique_ptr message, Postable& responseSink); // not public API - virtual void post(std::auto_ptr message); + virtual void post(std::unique_ptr message); private: class Entry diff --git a/src/libs/resiprocate/p2p/EventWrapper.hxx b/src/libs/resiprocate/p2p/EventWrapper.hxx index 041d184b..70a7e5ab 100644 --- a/src/libs/resiprocate/p2p/EventWrapper.hxx +++ b/src/libs/resiprocate/p2p/EventWrapper.hxx @@ -29,13 +29,13 @@ class EventWrapper : public Event private: - std::auto_ptr mWrapped; + std::unique_ptr mWrapped; }; template -static std::auto_ptr wrap(T* t) +static std::unique_ptr wrap(T* t) { - return std::auto_ptr(new EventWrapper(t)); + return std::unique_ptr(new EventWrapper(t)); } } diff --git a/src/libs/resiprocate/p2p/FetchAns.hxx b/src/libs/resiprocate/p2p/FetchAns.hxx index 723ec223..75264547 100644 --- a/src/libs/resiprocate/p2p/FetchAns.hxx +++ b/src/libs/resiprocate/p2p/FetchAns.hxx @@ -17,7 +17,7 @@ class FetchAns : public Message AbstractValues& values(); const AbstractValues& values() const; - std::auto_ptr event() + std::unique_ptr event() { return wrap(this); } diff --git a/src/libs/resiprocate/p2p/FetchReq.hxx b/src/libs/resiprocate/p2p/FetchReq.hxx index bbd8aefb..86c89846 100644 --- a/src/libs/resiprocate/p2p/FetchReq.hxx +++ b/src/libs/resiprocate/p2p/FetchReq.hxx @@ -19,7 +19,7 @@ class FetchReq : public ResourceMessage DataSpecifiers& specifiers(); const DataSpecifiers& specifiers() const; - std::auto_ptr event() + std::unique_ptr event() { return wrap(this); } diff --git a/src/libs/resiprocate/p2p/ForwardingLayer.hxx b/src/libs/resiprocate/p2p/ForwardingLayer.hxx index 4f8ca670..413f17b9 100644 --- a/src/libs/resiprocate/p2p/ForwardingLayer.hxx +++ b/src/libs/resiprocate/p2p/ForwardingLayer.hxx @@ -42,10 +42,10 @@ class ForwardingLayer: public EventConsumer virtual void consume(LocalCandidatesCollected& m); // from messages from above or below that need to be forwarded - void forward( std::auto_ptr m ); + void forward( std::unique_ptr m ); //not public api - virtual void post(std::auto_ptr event); + virtual void post(std::unique_ptr event); virtual resip::Data brief() const { diff --git a/src/libs/resiprocate/p2p/Join.hxx b/src/libs/resiprocate/p2p/Join.hxx index 79ed55d9..e7eb3dd6 100644 --- a/src/libs/resiprocate/p2p/Join.hxx +++ b/src/libs/resiprocate/p2p/Join.hxx @@ -20,7 +20,7 @@ public: virtual void getEncodedPayload(resip::DataStream &data); virtual resip::Data brief() const { return "JoinAns Message"; } - std::auto_ptr event() {return wrap(this);} + std::unique_ptr event() {return wrap(this);} protected: virtual void decodePayload(resip::DataStream &dataStream); @@ -38,7 +38,7 @@ public: virtual void getEncodedPayload(resip::DataStream &data); virtual resip::Data brief() const { return "JoinReq Message"; } - std::auto_ptr event() {return wrap(this);} + std::unique_ptr event() {return wrap(this);} protected: virtual void decodePayload(resip::DataStream &dataStream); diff --git a/src/libs/resiprocate/p2p/Leave.hxx b/src/libs/resiprocate/p2p/Leave.hxx index 57b1d28a..e1a453d0 100644 --- a/src/libs/resiprocate/p2p/Leave.hxx +++ b/src/libs/resiprocate/p2p/Leave.hxx @@ -20,7 +20,7 @@ public: virtual void getEncodedPayload(resip::DataStream &data); virtual resip::Data brief() const { return "LeaveAns Message"; } - std::auto_ptr event() {return wrap(this);} + std::unique_ptr event() {return wrap(this);} protected: @@ -40,7 +40,7 @@ public: virtual void getEncodedPayload(resip::DataStream &data); virtual resip::Data brief() const { return "LeaveReq Message"; } - std::auto_ptr event() {return wrap(this);} + std::unique_ptr event() {return wrap(this);} protected: virtual void decodePayload(resip::DataStream &dataStream); diff --git a/src/libs/resiprocate/p2p/Message.hxx b/src/libs/resiprocate/p2p/Message.hxx index 074c3907..18770142 100644 --- a/src/libs/resiprocate/p2p/Message.hxx +++ b/src/libs/resiprocate/p2p/Message.hxx @@ -121,7 +121,7 @@ class Message : public Signable DestinationId nextDestination() const; void popNextDestinationId(); - virtual std::auto_ptr event() = 0; + virtual std::unique_ptr event() = 0; virtual resip::Data brief() const =0; diff --git a/src/libs/resiprocate/p2p/Postable.hxx b/src/libs/resiprocate/p2p/Postable.hxx index 12b2bf4f..6a82e6f9 100644 --- a/src/libs/resiprocate/p2p/Postable.hxx +++ b/src/libs/resiprocate/p2p/Postable.hxx @@ -11,7 +11,7 @@ class Postable { public: virtual ~Postable(){} - virtual void post(std::auto_ptr posted)=0; + virtual void post(std::unique_ptr posted)=0; }; } diff --git a/src/libs/resiprocate/p2p/SelectTransporter.hxx b/src/libs/resiprocate/p2p/SelectTransporter.hxx index 8801c208..ef6665a0 100644 --- a/src/libs/resiprocate/p2p/SelectTransporter.hxx +++ b/src/libs/resiprocate/p2p/SelectTransporter.hxx @@ -44,8 +44,8 @@ class SelectTransporter : public Transporter void addListenerImpl(resip::TransportType transport, resip::GenericIPAddress &address); - void sendImpl(NodeId nodeId, std::auto_ptr msg); - void sendImpl(FlowId flowId, std::auto_ptr data); + void sendImpl(NodeId nodeId, std::unique_ptr msg); + void sendImpl(FlowId flowId, std::unique_ptr data); void collectCandidatesImpl(UInt64 tid, NodeId nodeId, unsigned short appId); diff --git a/src/libs/resiprocate/p2p/StoreAns.hxx b/src/libs/resiprocate/p2p/StoreAns.hxx index 5729b34e..45b66390 100644 --- a/src/libs/resiprocate/p2p/StoreAns.hxx +++ b/src/libs/resiprocate/p2p/StoreAns.hxx @@ -27,7 +27,7 @@ class StoreAns : public ResourceMessage } // call Event->dispatch(consumer) when you want to dispatch this - std::auto_ptr event() + std::unique_ptr event() { return wrap(this); } diff --git a/src/libs/resiprocate/p2p/StoreReq.hxx b/src/libs/resiprocate/p2p/StoreReq.hxx index f055ec79..81484392 100644 --- a/src/libs/resiprocate/p2p/StoreReq.hxx +++ b/src/libs/resiprocate/p2p/StoreReq.hxx @@ -23,7 +23,7 @@ class StoreReq : public ResourceMessage mReplicaNamber = number; } - std::auto_ptr event() + std::unique_ptr event() { return wrap(this); } diff --git a/src/libs/resiprocate/p2p/StoreSet.hxx b/src/libs/resiprocate/p2p/StoreSet.hxx index 2e75f194..cd90c182 100644 --- a/src/libs/resiprocate/p2p/StoreSet.hxx +++ b/src/libs/resiprocate/p2p/StoreSet.hxx @@ -15,10 +15,10 @@ class StoreSet : public EventConsumer, public: StoreSet(Dispatcher& dispatcher, TopologyApi& topology, - std::vector > stores); + std::vector > stores); virtual void consume(EventWrapper& event); - virtual void post(std::auto_ptr event) + virtual void post(std::unique_ptr event) { event->dispatch(this); } diff --git a/src/libs/resiprocate/p2p/Transporter.hxx b/src/libs/resiprocate/p2p/Transporter.hxx index 4d815823..e2057cf0 100644 --- a/src/libs/resiprocate/p2p/Transporter.hxx +++ b/src/libs/resiprocate/p2p/Transporter.hxx @@ -47,8 +47,8 @@ class Transporter void addListener(resip::TransportType transport, resip::GenericIPAddress &address); - void send(NodeId nodeId, std::auto_ptr msg); - void send(FlowId flowId, std::auto_ptr data); + void send(NodeId nodeId, std::unique_ptr msg); + void send(FlowId flowId, std::unique_ptr data); void collectCandidates(UInt64 tid, NodeId nodeId, unsigned short appId = RELOAD_APPLICATION_ID); @@ -69,8 +69,8 @@ class Transporter virtual void addListenerImpl(resip::TransportType transport, resip::GenericIPAddress &address) = 0; - virtual void sendImpl(NodeId nodeId, std::auto_ptr msg) = 0; - virtual void sendImpl(FlowId flowId, std::auto_ptr data) = 0; + virtual void sendImpl(NodeId nodeId, std::unique_ptr msg) = 0; + virtual void sendImpl(FlowId flowId, std::unique_ptr data) = 0; virtual void collectCandidatesImpl(UInt64 tid, NodeId, unsigned short appId) = 0; diff --git a/src/libs/resiprocate/p2p/TransporterMessage.hxx b/src/libs/resiprocate/p2p/TransporterMessage.hxx index 27e33aee..73d14b64 100644 --- a/src/libs/resiprocate/p2p/TransporterMessage.hxx +++ b/src/libs/resiprocate/p2p/TransporterMessage.hxx @@ -85,14 +85,14 @@ class ConnectionClosed : public Event class MessageArrived : public Event { public: - MessageArrived (NodeId nodeId, std::auto_ptr message) + MessageArrived (NodeId nodeId, std::unique_ptr message) : mNodeId(nodeId), mMessage(message) {} ~MessageArrived(); virtual void dispatch(EventConsumer& consumer); NodeId getNodeId() const {return mNodeId;} - std::auto_ptr getMessage() { assert(mMessage.get()); + std::unique_ptr getMessage() { assert(mMessage.get()); return mMessage; } virtual resip::Data brief() const @@ -104,7 +104,7 @@ class MessageArrived : public Event protected: NodeId mNodeId; - std::auto_ptr mMessage; + std::unique_ptr mMessage; }; class ApplicationMessageArrived : public Event diff --git a/src/libs/resiprocate/p2p/Update.hxx b/src/libs/resiprocate/p2p/Update.hxx index 7382c009..c58130e0 100644 --- a/src/libs/resiprocate/p2p/Update.hxx +++ b/src/libs/resiprocate/p2p/Update.hxx @@ -17,7 +17,7 @@ public: virtual resip::Data brief() const { return "UpdateAns Message"; } - std::auto_ptr event() + std::unique_ptr event() { return wrap(this); } @@ -42,7 +42,7 @@ public: virtual void getEncodedPayload(resip::DataStream &data); virtual resip::Data brief() const { return "UpdateReq Message"; } - std::auto_ptr event() + std::unique_ptr event() { return wrap(this); } diff --git a/src/libs/resiprocate/presSvr/SubDialog.cpp b/src/libs/resiprocate/presSvr/SubDialog.cpp index 53ed0ccb..22aa9d2d 100644 --- a/src/libs/resiprocate/presSvr/SubDialog.cpp +++ b/src/libs/resiprocate/presSvr/SubDialog.cpp @@ -56,7 +56,7 @@ SubDialog::processSubscribe(SipMessage* msg) } - auto_ptr resp(Helper::makeResponse(*msg,202,"")); + unique_ptr resp(Helper::makeResponse(*msg,202,"")); resp->header(h_Expires).value() = mSubState->expires()-time(NULL); mStack->send(*resp); diff --git a/src/libs/resiprocate/presSvr/SubDialogMgr.cpp b/src/libs/resiprocate/presSvr/SubDialogMgr.cpp index 99d36215..7525a83a 100644 --- a/src/libs/resiprocate/presSvr/SubDialogMgr.cpp +++ b/src/libs/resiprocate/presSvr/SubDialogMgr.cpp @@ -10,7 +10,7 @@ SubDialogMgr::dispatchSubscribe(SipMessage* msg) SubDialog *dialog = matchDialog(msg); if (!dialog) { - auto_ptr resp(Helper::makeResponse(*msg,481,"")); + unique_ptr resp(Helper::makeResponse(*msg,481,"")); mStack->send(*resp); // !dlb! return here? } diff --git a/src/libs/resiprocate/presSvr/TuPresSvr.cpp b/src/libs/resiprocate/presSvr/TuPresSvr.cpp index 4893c267..8f8449bc 100644 --- a/src/libs/resiprocate/presSvr/TuPresSvr.cpp +++ b/src/libs/resiprocate/presSvr/TuPresSvr.cpp @@ -34,7 +34,7 @@ TuPresSvr::process() } else if (msg->header(h_RequestLine).getMethod() == OPTIONS ) { - auto_ptr resp( + unique_ptr resp( Helper::makeResponse(*msg,500,"You Shot Me!")); mStack->send(*resp); done = 1; @@ -45,7 +45,7 @@ TuPresSvr::process() } else { - auto_ptr resp(Helper::makeResponse(*msg,501,"")); + unique_ptr resp(Helper::makeResponse(*msg,501,"")); mStack->send(*resp); } } @@ -86,7 +86,7 @@ void TuPresSvr::processNewSubscribe(SipMessage* msg) || msg->header(h_Event).value()!=presence.value() ) { - auto_ptr resp(Helper::makeResponse(*msg,489,"")); + unique_ptr resp(Helper::makeResponse(*msg,489,"")); resp->header(h_AllowEvents).push_back(presence); mStack->send(*resp); return; @@ -99,7 +99,7 @@ void TuPresSvr::processNewSubscribe(SipMessage* msg) } else { - auto_ptr resp(Helper::makeResponse(*msg,404,"")); + unique_ptr resp(Helper::makeResponse(*msg,404,"")); mStack->send(*resp); } @@ -126,18 +126,18 @@ void TuPresSvr::processPublish(SipMessage* msg) { int retcode = (ResourceMgr::instance().setPresenceDocument(aor,contents) ?200:403); - auto_ptr resp(Helper::makeResponse(*msg,retcode,"")); + unique_ptr resp(Helper::makeResponse(*msg,retcode,"")); mStack->send(*resp); } else { - auto_ptr resp(Helper::makeResponse(*msg,400,"This hacked-up service requires a body")); + unique_ptr resp(Helper::makeResponse(*msg,400,"This hacked-up service requires a body")); mStack->send(*resp); } } else { - auto_ptr resp(Helper::makeResponse(*msg,404,"")); + unique_ptr resp(Helper::makeResponse(*msg,404,"")); mStack->send(*resp); } } diff --git a/src/libs/resiprocate/reflow/dtls_wrapper/DtlsFactory.hxx b/src/libs/resiprocate/reflow/dtls_wrapper/DtlsFactory.hxx index fcaedd38..03a1d51b 100644 --- a/src/libs/resiprocate/reflow/dtls_wrapper/DtlsFactory.hxx +++ b/src/libs/resiprocate/reflow/dtls_wrapper/DtlsFactory.hxx @@ -27,17 +27,17 @@ class DtlsFactory enum PacketType { rtp, dtls, stun, unknown}; // Creates a DTLS SSL Context and enables srtp extension, also sets the private and public key cert - DtlsFactory(std::auto_ptr tc, X509 *cert, EVP_PKEY *privkey); + DtlsFactory(std::unique_ptr tc, X509 *cert, EVP_PKEY *privkey); // Note: this orphans any DtlsSockets you were stupid enough // not to free ~DtlsFactory(); // Creates a new DtlsSocket to be used as a client - DtlsSocket* createClient(std::auto_ptr context); + DtlsSocket* createClient(std::unique_ptr context); // Creates a new DtlsSocket to be used as a server - DtlsSocket* createServer(std::auto_ptr context); + DtlsSocket* createServer(std::unique_ptr context); // Returns the fingerprint of the user cert that was passed into the constructor void getMyCertFingerprint(char *fingerprint); @@ -60,7 +60,7 @@ class DtlsFactory private: friend class DtlsSocket; SSL_CTX* mContext; - std::auto_ptr mTimerContext; + std::unique_ptr mTimerContext; X509 *mCert; }; diff --git a/src/libs/resiprocate/reflow/dtls_wrapper/DtlsSocket.hxx b/src/libs/resiprocate/reflow/dtls_wrapper/DtlsSocket.hxx index 300512c1..2269c931 100644 --- a/src/libs/resiprocate/reflow/dtls_wrapper/DtlsSocket.hxx +++ b/src/libs/resiprocate/reflow/dtls_wrapper/DtlsSocket.hxx @@ -116,7 +116,7 @@ class DtlsSocket void forceRetransmit(); // Creates an SSL socket, and if client sets state to connect_state and if server sets state to accept_state. Sets SSL BIO's. - DtlsSocket(std::auto_ptr socketContext, DtlsFactory* factory, enum SocketType); + DtlsSocket(std::unique_ptr socketContext, DtlsFactory* factory, enum SocketType); // Give CPU cyces to the handshake process - checks current state and acts appropraitely void doHandshakeIteration(); @@ -125,7 +125,7 @@ class DtlsSocket int getReadTimeout(); // Internals - std::auto_ptr mSocketContext; + std::unique_ptr mSocketContext; DtlsFactory* mFactory; DtlsTimer *mReadTimer; // Timer used during handshake process diff --git a/src/libs/resiprocate/repro/AccountingCollector.hxx b/src/libs/resiprocate/repro/AccountingCollector.hxx index 916aa284..be57bf4a 100644 --- a/src/libs/resiprocate/repro/AccountingCollector.hxx +++ b/src/libs/resiprocate/repro/AccountingCollector.hxx @@ -71,7 +71,7 @@ private: resip::TimeLimitFifo mFifo; PersistentMessageEnqueue* initializeEventQueue(FifoEventType type, bool destroyFirst=false); void pushEventObjectToQueue(json::Object& object, FifoEventType type); - void internalProcess(std::auto_ptr eventData); + void internalProcess(std::unique_ptr eventData); }; } diff --git a/src/libs/resiprocate/repro/AsyncProcessor.hxx b/src/libs/resiprocate/repro/AsyncProcessor.hxx index 1dfeb5da..2f109f23 100644 --- a/src/libs/resiprocate/repro/AsyncProcessor.hxx +++ b/src/libs/resiprocate/repro/AsyncProcessor.hxx @@ -79,7 +79,7 @@ class MyAsyncProcessor : public AsyncProcessor // Dispatch async request to worker thread pool MyAsyncProcessorAsyncMessage* async = new MyAsyncProcessorAsyncMessage(*this, rc.getTransactionId(), &rc.getProxy()); async->mDataRequiredToCallBlockingFunction = "foo"; - mAsyncDispatcher->post(std::auto_ptr(async)); + mAsyncDispatcher->post(std::unique_ptr(async)); return WaitingForEvent; } } diff --git a/src/libs/resiprocate/repro/Dispatcher.hxx b/src/libs/resiprocate/repro/Dispatcher.hxx index fc347d96..427cad8e 100644 --- a/src/libs/resiprocate/repro/Dispatcher.hxx +++ b/src/libs/resiprocate/repro/Dispatcher.hxx @@ -52,7 +52,7 @@ class Dispatcher @param startImmediately Whether to start this thread bank on construction. */ - Dispatcher(std::auto_ptr prototype, + Dispatcher(std::unique_ptr prototype, resip::SipStack* stack, int workers=2, bool startImmediately=true); @@ -70,7 +70,7 @@ class Dispatcher @returns true iff this message was successfully posted. (This may not be the case if this Dispatcher is in the process of shutting down) */ - virtual bool post(std::auto_ptr& work); + virtual bool post(std::unique_ptr& work); /** @returns The number of messages in this Dispatcher's queue diff --git a/src/libs/resiprocate/repro/ProcessorChain.hxx b/src/libs/resiprocate/repro/ProcessorChain.hxx index 53bf7436..535a2669 100644 --- a/src/libs/resiprocate/repro/ProcessorChain.hxx +++ b/src/libs/resiprocate/repro/ProcessorChain.hxx @@ -14,7 +14,7 @@ class ProcessorChain : public Processor ProcessorChain(ChainType type); virtual ~ProcessorChain(); - void addProcessor(std::auto_ptr); + void addProcessor(std::unique_ptr); virtual processor_action_t process(RequestContext &); diff --git a/src/libs/resiprocate/repro/Proxy.hxx b/src/libs/resiprocate/repro/Proxy.hxx index 3831553c..b41e1dcc 100644 --- a/src/libs/resiprocate/repro/Proxy.hxx +++ b/src/libs/resiprocate/repro/Proxy.hxx @@ -66,7 +66,7 @@ class Proxy : public resip::TransactionUser, public resip::ThreadIf // Note: These are not thread safe and should be called before run() only void setOptionsHandler(OptionsHandler* handler); - void setRequestContextFactory(std::auto_ptr requestContextFactory); + void setRequestContextFactory(std::unique_ptr requestContextFactory); virtual bool isShutDown() const ; virtual void thread(); @@ -86,9 +86,9 @@ class Proxy : public resip::TransactionUser, public resip::ThreadIf void send(const resip::SipMessage& msg); void addClientTransaction(const resip::Data& transactionId, RequestContext* rc); - void postTimerC(std::auto_ptr tc); + void postTimerC(std::unique_ptr tc); - void postMS(std::auto_ptr msg, int msec); + void postMS(std::unique_ptr msg, int msec); bool compressionEnabled() const; @@ -134,7 +134,7 @@ class Proxy : public resip::TransactionUser, public resip::ThreadIf UserStore &mUserStore; std::set mSupportedOptions; OptionsHandler* mOptionsHandler; - std::auto_ptr mRequestContextFactory; + std::unique_ptr mRequestContextFactory; bool mSessionAccountingEnabled; bool mRegistrationAccountingEnabled; diff --git a/src/libs/resiprocate/repro/ReproRunner.hxx b/src/libs/resiprocate/repro/ReproRunner.hxx index 41b96879..aa64ba60 100644 --- a/src/libs/resiprocate/repro/ReproRunner.hxx +++ b/src/libs/resiprocate/repro/ReproRunner.hxx @@ -64,7 +64,7 @@ protected: virtual resip::Data addDomains(resip::TransactionUser& tu, bool log); virtual bool addTransports(bool& allTransportsSpecifyRecordRoute); // Override this and examine the processor name to selectively add custom processors before or after the standard ones - virtual void addProcessor(repro::ProcessorChain& chain, std::auto_ptr processor); + virtual void addProcessor(repro::ProcessorChain& chain, std::unique_ptr processor); virtual void makeRequestProcessorChain(repro::ProcessorChain& chain); virtual void makeResponseProcessorChain(repro::ProcessorChain& chain); virtual void makeTargetProcessorChain(repro::ProcessorChain& chain); diff --git a/src/libs/resiprocate/repro/RequestContext.hxx b/src/libs/resiprocate/repro/RequestContext.hxx index 04181f64..bad3e58e 100644 --- a/src/libs/resiprocate/repro/RequestContext.hxx +++ b/src/libs/resiprocate/repro/RequestContext.hxx @@ -33,8 +33,8 @@ class RequestContext virtual ~RequestContext(); virtual void process(resip::TransactionTerminated& msg); - virtual void process(std::auto_ptr sip); - virtual void process(std::auto_ptr app); + virtual void process(std::unique_ptr sip); + virtual void process(std::unique_ptr app); virtual void handleSelfAimedStrayAck(resip::SipMessage* sip); virtual void cancelClientTransaction(const resip::Data& tid); @@ -69,7 +69,7 @@ class RequestContext void setSessionCreatedEventSent() { mSessionCreatedEventSent = true; } void setSessionEstablishedEventSent() { mSessionEstablishedEventSent = true; } - void postTimedMessage(std::auto_ptr msg,int seconds); + void postTimedMessage(std::unique_ptr msg,int seconds); // Accessor for per-requset extensible state storage for monkeys resip::KeyValueStore& getKeyValueStore() { return mKeyValueStore; } diff --git a/src/libs/resiprocate/repro/ResponseContext.hxx b/src/libs/resiprocate/repro/ResponseContext.hxx index 4b6a5af1..d0be55b1 100644 --- a/src/libs/resiprocate/repro/ResponseContext.hxx +++ b/src/libs/resiprocate/repro/ResponseContext.hxx @@ -68,7 +68,7 @@ class ResponseContext @note Targets are not checked for duplicate uris until an attempt is made to start them. */ - bool addTarget(std::auto_ptr target, bool beginImmediately=false); + bool addTarget(std::unique_ptr target, bool beginImmediately=false); /** Adds a batch of Targets. diff --git a/src/libs/resiprocate/resip/dum/ClientAuthExtension.cxx b/src/libs/resiprocate/resip/dum/ClientAuthExtension.cxx index 7b256f5f..55eda67f 100644 --- a/src/libs/resiprocate/resip/dum/ClientAuthExtension.cxx +++ b/src/libs/resiprocate/resip/dum/ClientAuthExtension.cxx @@ -7,7 +7,7 @@ std::unique_ptr ClientAuthExtension::mInstance = std::uniqu void ClientAuthExtension::setInstance(std::unique_ptr ext) { - mInstance = ext; + mInstance = std::move(ext); } diff --git a/src/libs/resiprocate/resip/dum/ClientAuthExtension.hxx b/src/libs/resiprocate/resip/dum/ClientAuthExtension.hxx index 3c77762d..4c7a2c8b 100644 --- a/src/libs/resiprocate/resip/dum/ClientAuthExtension.hxx +++ b/src/libs/resiprocate/resip/dum/ClientAuthExtension.hxx @@ -45,7 +45,7 @@ class ClientAuthExtension virtual bool algorithmAndQopSupported(const Auth& challenge); - static void setInstance(std::auto_ptr ext); + static void setInstance(std::unique_ptr ext); static ClientAuthExtension& instance() { return *mInstance; @@ -54,7 +54,7 @@ class ClientAuthExtension ClientAuthExtension() {} - static std::auto_ptr mInstance; + static std::unique_ptr mInstance; }; diff --git a/src/libs/resiprocate/resip/dum/ClientAuthManager.cxx b/src/libs/resiprocate/resip/dum/ClientAuthManager.cxx index 7c4b1130..4770e071 100644 --- a/src/libs/resiprocate/resip/dum/ClientAuthManager.cxx +++ b/src/libs/resiprocate/resip/dum/ClientAuthManager.cxx @@ -414,7 +414,7 @@ ClientAuthManager::RealmState::addAuthentication(SipMessage& request) // Add client auth decorator so that we ensure any body hashes are calcuated after user defined outbound decorators that // may be modifying the message body std::unique_ptr clientAuthDecorator(new ClientAuthDecorator(mIsProxyCredential, mAuth, mCredential, authQop, nonceCountString)); - request.addOutboundDecorator(clientAuthDecorator); + request.addOutboundDecorator(std::move(clientAuthDecorator)); } void ClientAuthManager::dialogSetDestroyed(const DialogSetId& id) diff --git a/src/libs/resiprocate/resip/dum/ClientInviteSession.cxx b/src/libs/resiprocate/resip/dum/ClientInviteSession.cxx index 05a06b3e..948f07b1 100644 --- a/src/libs/resiprocate/resip/dum/ClientInviteSession.cxx +++ b/src/libs/resiprocate/resip/dum/ClientInviteSession.cxx @@ -124,7 +124,7 @@ ClientInviteSession::provideAnswer (const Contents& answer) transition(UAC_SentAnswer); // Remember proposed local offerAnswer. - mCurrentRemoteOfferAnswer = mProposedRemoteOfferAnswer; + mCurrentRemoteOfferAnswer = std::move(mProposedRemoteOfferAnswer); mCurrentLocalOfferAnswer = InviteSession::makeOfferAnswer(answer); // Creates an PRACK request with application supplied offer. @@ -137,7 +137,7 @@ ClientInviteSession::provideAnswer (const Contents& answer) transition(Connected); sendAck(&answer); - mCurrentRemoteOfferAnswer = mProposedRemoteOfferAnswer; + mCurrentRemoteOfferAnswer = std::move(mProposedRemoteOfferAnswer); mCurrentLocalOfferAnswer = InviteSession::makeOfferAnswer(answer); // mLastSessionModification = ack; // ?slg? is this needed? break; @@ -154,7 +154,7 @@ ClientInviteSession::provideAnswer (const Contents& answer) mDialog.makeResponse(*response, *mLastRemoteSessionModification, 200); InviteSession::setOfferAnswer(*response, answer, 0); mCurrentLocalOfferAnswer = InviteSession::makeOfferAnswer(answer); - mCurrentRemoteOfferAnswer = mProposedRemoteOfferAnswer; + mCurrentRemoteOfferAnswer = std::move(mProposedRemoteOfferAnswer); InfoLog (<< "Sending " << response->brief()); DumHelper::setOutgoingEncryptionLevel(*response, mCurrentEncryptionLevel); send(response); diff --git a/src/libs/resiprocate/resip/dum/ClientInviteSession.hxx b/src/libs/resiprocate/resip/dum/ClientInviteSession.hxx index 6ce73641..7e4d2164 100644 --- a/src/libs/resiprocate/resip/dum/ClientInviteSession.hxx +++ b/src/libs/resiprocate/resip/dum/ClientInviteSession.hxx @@ -85,7 +85,7 @@ class ClientInviteSession : public InviteSession void onProvisionalAspect(ClientInviteSessionHandle c, const SipMessage& msg); void onFailureAspect(ClientInviteSessionHandle c, const SipMessage& msg); - std::auto_ptr mEarlyMedia; + std::unique_ptr mEarlyMedia; RAckCategory mRelRespInfo; unsigned int mStaleCallTimerSeq; diff --git a/src/libs/resiprocate/resip/dum/ClientPagerMessage.cxx b/src/libs/resiprocate/resip/dum/ClientPagerMessage.cxx index 5064556b..d1e73ae3 100644 --- a/src/libs/resiprocate/resip/dum/ClientPagerMessage.cxx +++ b/src/libs/resiprocate/resip/dum/ClientPagerMessage.cxx @@ -135,7 +135,7 @@ public: std::unique_ptr contents, DialogUsageManager::EncryptionLevel level) : mClientPagerMessage(clientPagerMessage), - mContents(contents), + mContents(std::move(contents)), mLevel(level) { @@ -143,7 +143,7 @@ public: virtual void executeCommand() { - mClientPagerMessage.page(mContents, mLevel); + mClientPagerMessage.page(std::move(mContents), mLevel); } virtual EncodeStream& encodeBrief(EncodeStream& strm) const @@ -160,7 +160,7 @@ void ClientPagerMessage::pageCommand(std::unique_ptr contents, DialogUsageManager::EncryptionLevel level) { - mDum.post(new ClientPagerMessagePageCommand(*this, contents, level)); + mDum.post(new ClientPagerMessagePageCommand(*this, std::move(contents), level)); } void diff --git a/src/libs/resiprocate/resip/dum/ClientPagerMessage.hxx b/src/libs/resiprocate/resip/dum/ClientPagerMessage.hxx index 26747c3d..92e60f23 100644 --- a/src/libs/resiprocate/resip/dum/ClientPagerMessage.hxx +++ b/src/libs/resiprocate/resip/dum/ClientPagerMessage.hxx @@ -28,14 +28,14 @@ class ClientPagerMessage : public NonDialogUsage //queues the message if there is one sent but not yet received a response //for it. //asserts if contents->get() is NULL. - virtual void page(std::auto_ptr contents, DialogUsageManager::EncryptionLevel level=DialogUsageManager::None); + virtual void page(std::unique_ptr contents, DialogUsageManager::EncryptionLevel level=DialogUsageManager::None); virtual void end(); /** * Provide asynchronous method access by using command */ virtual void endCommand(); - virtual void pageCommand(std::auto_ptr contents, DialogUsageManager::EncryptionLevel level=DialogUsageManager::None); + virtual void pageCommand(std::unique_ptr contents, DialogUsageManager::EncryptionLevel level=DialogUsageManager::None); virtual void dispatch(const SipMessage& msg); virtual void dispatch(const DumTimeout& timer); diff --git a/src/libs/resiprocate/resip/dum/DialogEventInfo.hxx b/src/libs/resiprocate/resip/dum/DialogEventInfo.hxx index d93c2aea..63707adb 100644 --- a/src/libs/resiprocate/resip/dum/DialogEventInfo.hxx +++ b/src/libs/resiprocate/resip/dum/DialogEventInfo.hxx @@ -83,22 +83,22 @@ class DialogEventInfo DialogId mDialogId; Direction mDirection; //ID of the dialog this dialog replaced. - std::auto_ptr mReplacesId; + std::unique_ptr mReplacesId; InviteSessionHandle mInviteSession; - std::auto_ptr mReferredBy; + std::unique_ptr mReferredBy; //could back-point to dialog for this information to save space NameAddrs mRouteSet; NameAddr mLocalIdentity; NameAddr mRemoteIdentity; Uri mLocalTarget; - std::auto_ptr mRemoteTarget; + std::unique_ptr mRemoteTarget; UInt64 mCreationTimeSeconds; - std::auto_ptr mLocalOfferAnswer; - std::auto_ptr mRemoteOfferAnswer; + std::unique_ptr mLocalOfferAnswer; + std::unique_ptr mRemoteOfferAnswer; private: bool mReplaced; diff --git a/src/libs/resiprocate/resip/dum/DialogUsageManager.cxx b/src/libs/resiprocate/resip/dum/DialogUsageManager.cxx index 7d4daf19..f3487bb4 100644 --- a/src/libs/resiprocate/resip/dum/DialogUsageManager.cxx +++ b/src/libs/resiprocate/resip/dum/DialogUsageManager.cxx @@ -294,7 +294,7 @@ DialogUsageManager::forceShutdown(DumShutdownHandler* h) void DialogUsageManager::setAppDialogSetFactory(std::unique_ptr factory) { - mAppDialogSetFactory = factory; + mAppDialogSetFactory = std::move(factory); } SharedPtr& @@ -320,13 +320,13 @@ void DialogUsageManager::setMasterProfile(const SharedPtr& master void DialogUsageManager::setKeepAliveManager(std::unique_ptr manager) { - mKeepAliveManager = manager; + mKeepAliveManager = std::move(manager); mKeepAliveManager->setDialogUsageManager(this); } void DialogUsageManager::setRedirectManager(std::unique_ptr manager) { - mRedirectManager = manager; + mRedirectManager = std::move(manager); } void DialogUsageManager::setRedirectHandler(RedirectHandler* handler) @@ -342,7 +342,7 @@ RedirectHandler* DialogUsageManager::getRedirectHandler() void DialogUsageManager::setClientAuthManager(std::unique_ptr manager) { - mClientAuthManager = manager; + mClientAuthManager = std::move(manager); } void @@ -1087,11 +1087,11 @@ void DialogUsageManager::outgoingProcess(unique_ptr message) !event->message()->header(h_Routes).front().uri().exists(p_lr)) { Helper::processStrictRoute(*toSend); - sendUsingOutboundIfAppropriate(*userProfile, toSend); + sendUsingOutboundIfAppropriate(*userProfile, std::move(toSend)); } else { - sendUsingOutboundIfAppropriate(*userProfile, toSend); + sendUsingOutboundIfAppropriate(*userProfile, std::move(toSend)); } } else @@ -1121,12 +1121,12 @@ DialogUsageManager::sendUsingOutboundIfAppropriate(UserProfile& userProfile, uni { DebugLog ( << "Sending with client outbound flow tuple to express outbound" ); DebugLog ( << "Flow Tuple: " << userProfile.mClientOutboundFlowTuple << " and key: " << userProfile.mClientOutboundFlowTuple.mFlowKey); - mStack.sendTo(msg, userProfile.mClientOutboundFlowTuple, this); + mStack.sendTo(std::move(msg), userProfile.mClientOutboundFlowTuple, this); } else { DebugLog ( << "Sending to express outbound w/o flow tuple"); - mStack.send(msg, this); + mStack.send(std::move(msg), this); } } else @@ -1134,12 +1134,12 @@ DialogUsageManager::sendUsingOutboundIfAppropriate(UserProfile& userProfile, uni if(userProfile.clientOutboundEnabled() && userProfile.mClientOutboundFlowTuple.mFlowKey != 0) { DebugLog ( << "Sending to outbound (no express) with flow tuple"); - mStack.sendTo(msg, userProfile.mClientOutboundFlowTuple, this); + mStack.sendTo(std::move(msg), userProfile.mClientOutboundFlowTuple, this); } else { DebugLog ( << "Sending to outbound uri"); - mStack.sendTo(msg, userProfile.getOutboundProxy().uri(), this); + mStack.sendTo(std::move(msg), userProfile.getOutboundProxy().uri(), this); } } } @@ -1148,11 +1148,11 @@ DialogUsageManager::sendUsingOutboundIfAppropriate(UserProfile& userProfile, uni DebugLog (<< "Send: " << msg->brief()); if(userProfile.clientOutboundEnabled() && userProfile.mClientOutboundFlowTuple.mFlowKey != 0) { - mStack.sendTo(msg, userProfile.mClientOutboundFlowTuple, this); + mStack.sendTo(std::move(msg), userProfile.mClientOutboundFlowTuple, this); } else { - mStack.send(msg, this); + mStack.send(std::move(msg), this); } } } @@ -1162,7 +1162,7 @@ void DialogUsageManager::end(DialogSetId setid) { DialogSet* ds = findDialogSet(setid); - if (ds == 0) + if (ds == nullptr) { throw Exception("Request no longer exists", __FILE__, __LINE__); } @@ -1480,7 +1480,7 @@ DialogUsageManager::internalProcess(std::unique_ptr msg) } } - incomingProcess(msg); + incomingProcess(std::move(msg)); } void @@ -1714,7 +1714,7 @@ DialogUsageManager::process(int timeoutMs, resip::Lockable* mutex) #ifdef RESIP_DUM_THREAD_DEBUG mThreadDebugKey=mHiddenThreadDebugKey; #endif - internalProcess(message); + internalProcess(std::move(message)); #ifdef RESIP_DUM_THREAD_DEBUG // .bwc. Thread checking is disabled if mThreadDebugKey is 0; if the app // is using this mutex-locked process() call, we only enable thread- diff --git a/src/libs/resiprocate/resip/dum/DialogUsageManager.hxx b/src/libs/resiprocate/resip/dum/DialogUsageManager.hxx index cb51445c..ecef8d83 100644 --- a/src/libs/resiprocate/resip/dum/DialogUsageManager.hxx +++ b/src/libs/resiprocate/resip/dum/DialogUsageManager.hxx @@ -128,7 +128,7 @@ class DialogUsageManager : public HandleManager, public TransactionUser Data getHostAddress(); - void setAppDialogSetFactory(std::auto_ptr); + void setAppDialogSetFactory(std::unique_ptr); void setMasterProfile(const SharedPtr& masterProfile); SharedPtr& getMasterProfile(); @@ -137,18 +137,18 @@ class DialogUsageManager : public HandleManager, public TransactionUser //optional handler to track the progress of DialogSets void setDialogSetHandler(DialogSetHandler* handler); - void setKeepAliveManager(std::auto_ptr keepAlive); + void setKeepAliveManager(std::unique_ptr keepAlive); //There is a default RedirectManager. Setting one may cause the old one //to be deleted. - void setRedirectManager(std::auto_ptr redirect); + void setRedirectManager(std::unique_ptr redirect); //informational, so a RedirectHandler is not required void setRedirectHandler(RedirectHandler* handler); RedirectHandler* getRedirectHandler(); /// If there is no ClientAuthManager, when the client receives a 401/407, /// pass it up through the normal BaseUsageHandler - void setClientAuthManager(std::auto_ptr client); + void setClientAuthManager(std::unique_ptr client); /// If there is no ServerAuthManager, the server does not authenticate requests void setServerAuthManager(resip::SharedPtr server); @@ -188,7 +188,7 @@ class DialogUsageManager : public HandleManager, public TransactionUser /// Sets a manager to handle storage of registration state void setRegistrationPersistenceManager(RegistrationPersistenceManager*); - void setRemoteCertStore(std::auto_ptr store); + void setRemoteCertStore(std::unique_ptr store); // The message is owned by the underlying datastructure and may go away in // the future. If the caller wants to keep it, it should make a copy. The @@ -338,7 +338,7 @@ class DialogUsageManager : public HandleManager, public TransactionUser //exposed so DumThread variants can be written Message* getNext(int ms) { return mFifo.getNext(ms); } - void internalProcess(std::auto_ptr msg); + void internalProcess(std::unique_ptr msg); bool messageAvailable(void) { return mFifo.messageAvailable(); } void applyToAllClientSubscriptions(ClientSubscriptionFunctor*); @@ -400,9 +400,9 @@ class DialogUsageManager : public HandleManager, public TransactionUser { } - virtual void post(std::auto_ptr msg) + virtual void post(std::unique_ptr msg) { - mDum.incomingProcess(msg); + mDum.incomingProcess(std::move(msg)); } }; @@ -413,9 +413,9 @@ class DialogUsageManager : public HandleManager, public TransactionUser { } - virtual void post(std::auto_ptr msg) + virtual void post(std::unique_ptr msg) { - mDum.outgoingProcess(msg); + mDum.outgoingProcess(std::move(msg)); } }; @@ -430,7 +430,7 @@ class DialogUsageManager : public HandleManager, public TransactionUser // May call a callback to let the app adorn void sendResponse(const SipMessage& response); - void sendUsingOutboundIfAppropriate(UserProfile& userProfile, std::auto_ptr msg); + void sendUsingOutboundIfAppropriate(UserProfile& userProfile, std::unique_ptr msg); void addTimer(DumTimeout::Type type, unsigned long durationSeconds, @@ -472,8 +472,8 @@ class DialogUsageManager : public HandleManager, public TransactionUser bool queueForIdentityCheck(SipMessage* msg); void processIdentityCheckResponse(const HttpGetMessage& msg); - void incomingProcess(std::auto_ptr msg); - void outgoingProcess(std::auto_ptr msg); + void incomingProcess(std::unique_ptr msg); + void outgoingProcess(std::unique_ptr msg); void processExternalMessage(ExternalMessageBase* externalMessage); // For delayed delete of a Usage @@ -495,9 +495,9 @@ class DialogUsageManager : public HandleManager, public TransactionUser SharedPtr mMasterProfile; SharedPtr mMasterUserProfile; - std::auto_ptr mRedirectManager; - std::auto_ptr mClientAuthManager; - //std::auto_ptr mServerAuthManager; + std::unique_ptr mRedirectManager; + std::unique_ptr mClientAuthManager; + //std::unique_ptr mServerAuthManager; InviteSessionHandler* mInviteSessionHandler; ClientRegistrationHandler* mClientRegistrationHandler; @@ -515,7 +515,7 @@ class DialogUsageManager : public HandleManager, public TransactionUser std::map mClientPublicationHandlers; std::map mServerPublicationHandlers; std::map mOutOfDialogHandlers; - std::auto_ptr mKeepAliveManager; + std::unique_ptr mKeepAliveManager; bool mIsDefaultServerReferHandler; ClientPagerMessageHandler* mClientPagerMessageHandler; @@ -526,7 +526,7 @@ class DialogUsageManager : public HandleManager, public TransactionUser // server subscription handler for the 'dialog' event... DialogEventStateManager* mDialogEventStateManager; - std::auto_ptr mAppDialogSetFactory; + std::unique_ptr mAppDialogSetFactory; SipStack& mStack; DumShutdownHandler* mDumShutdownHandler; diff --git a/src/libs/resiprocate/resip/dum/DumFeature.cxx b/src/libs/resiprocate/resip/dum/DumFeature.cxx index de451888..a3e752e6 100644 --- a/src/libs/resiprocate/resip/dum/DumFeature.cxx +++ b/src/libs/resiprocate/resip/dum/DumFeature.cxx @@ -18,5 +18,5 @@ DumFeature::~DumFeature() void DumFeature::postCommand(std::unique_ptr message) { - mDum.post(new TargetCommand(mTarget, message)); + mDum.post(new TargetCommand(mTarget, std::move(message))); } diff --git a/src/libs/resiprocate/resip/dum/DumFeature.hxx b/src/libs/resiprocate/resip/dum/DumFeature.hxx index 00f5d5a6..eecf41b4 100644 --- a/src/libs/resiprocate/resip/dum/DumFeature.hxx +++ b/src/libs/resiprocate/resip/dum/DumFeature.hxx @@ -40,7 +40,7 @@ class DumFeature // taken ownership of msg until we get a return. If we throw, the // ownership of msg is unknown. This is unacceptable. virtual ProcessingResult process(Message* msg) = 0; - virtual void postCommand(std::auto_ptr message); + virtual void postCommand(std::unique_ptr message); protected: DialogUsageManager& mDum; diff --git a/src/libs/resiprocate/resip/dum/DumThread.cxx b/src/libs/resiprocate/resip/dum/DumThread.cxx index 5403b880..b5987596 100644 --- a/src/libs/resiprocate/resip/dum/DumThread.cxx +++ b/src/libs/resiprocate/resip/dum/DumThread.cxx @@ -21,7 +21,7 @@ DumThread::thread() std::unique_ptr msg(mDum.mFifo.getNext(1000)); // Only need to wake up to see if we are shutdown if (msg.get()) { - mDum.internalProcess(msg); + mDum.internalProcess(std::move(msg)); } } catch (BaseException& e) diff --git a/src/libs/resiprocate/resip/dum/HttpProvider.cxx b/src/libs/resiprocate/resip/dum/HttpProvider.cxx index 91e0f72d..0748fe79 100644 --- a/src/libs/resiprocate/resip/dum/HttpProvider.cxx +++ b/src/libs/resiprocate/resip/dum/HttpProvider.cxx @@ -10,7 +10,7 @@ Mutex HttpProvider::mMutex; void HttpProvider::setFactory(std::unique_ptr fact) { - mFactory = fact; + mFactory = std::move(fact); } HttpProvider* diff --git a/src/libs/resiprocate/resip/dum/HttpProvider.hxx b/src/libs/resiprocate/resip/dum/HttpProvider.hxx index b2ef4fe9..2b3045ac 100644 --- a/src/libs/resiprocate/resip/dum/HttpProvider.hxx +++ b/src/libs/resiprocate/resip/dum/HttpProvider.hxx @@ -21,7 +21,7 @@ class HttpProvider { public: //HttpProvider assumes memory - static void setFactory(std::auto_ptr fact); + static void setFactory(std::unique_ptr fact); //ptr so users can check for existence static HttpProvider* instance(); @@ -30,7 +30,7 @@ class HttpProvider virtual ~HttpProvider(){} //impl. singleton destructor pattern later private: static HttpProvider* mInstance; - static std::auto_ptr mFactory; + static std::unique_ptr mFactory; static Mutex mMutex; }; diff --git a/src/libs/resiprocate/resip/dum/IdentityHandler.cxx b/src/libs/resiprocate/resip/dum/IdentityHandler.cxx index 524f4956..8080b1be 100644 --- a/src/libs/resiprocate/resip/dum/IdentityHandler.cxx +++ b/src/libs/resiprocate/resip/dum/IdentityHandler.cxx @@ -101,7 +101,7 @@ IdentityHandler::queueForIdentityCheck(SipMessage* sipMsg) std::unique_ptr sec(new SecurityAttributes); sec->setIdentity(sipMsg->header(h_From).uri().getAor()); sec->setIdentityStrength(SecurityAttributes::From); - sipMsg->setSecurityAttributes(sec); + sipMsg->setSecurityAttributes(std::move(sec)); return false; } diff --git a/src/libs/resiprocate/resip/dum/InviteSession.cxx b/src/libs/resiprocate/resip/dum/InviteSession.cxx index 31d85c5b..fda03f79 100644 --- a/src/libs/resiprocate/resip/dum/InviteSession.cxx +++ b/src/libs/resiprocate/resip/dum/InviteSession.cxx @@ -564,7 +564,7 @@ InviteSession::provideAnswer(const Contents& answer) handleSessionTimerRequest(*mInvite200, *mLastRemoteSessionModification); InviteSession::setOfferAnswer(*mInvite200, answer, 0); mCurrentLocalOfferAnswer = InviteSession::makeOfferAnswer(answer); - mCurrentRemoteOfferAnswer = mProposedRemoteOfferAnswer; + mCurrentRemoteOfferAnswer = std::move(mProposedRemoteOfferAnswer); InfoLog (<< "Sending " << mInvite200->brief()); DumHelper::setOutgoingEncryptionLevel(*mInvite200, mCurrentEncryptionLevel); send(mInvite200); @@ -578,9 +578,9 @@ InviteSession::provideAnswer(const Contents& answer) SharedPtr response(new SipMessage); mDialog.makeResponse(*response, *mLastRemoteSessionModification, 200); handleSessionTimerRequest(*response, *mLastRemoteSessionModification); - InviteSession::setOfferAnswer(*response, answer, 0); + InviteSession::setOfferAnswer(*response, answer, nullptr); mCurrentLocalOfferAnswer = InviteSession::makeOfferAnswer(answer); - mCurrentRemoteOfferAnswer = mProposedRemoteOfferAnswer; + mCurrentRemoteOfferAnswer = std::move(mProposedRemoteOfferAnswer); InfoLog (<< "Sending " << response->brief()); DumHelper::setOutgoingEncryptionLevel(*response, mCurrentEncryptionLevel); send(response); @@ -591,7 +591,7 @@ InviteSession::provideAnswer(const Contents& answer) transition(Connected); sendAck(&answer); - mCurrentRemoteOfferAnswer = mProposedRemoteOfferAnswer; + mCurrentRemoteOfferAnswer = std::move(mProposedRemoteOfferAnswer); mCurrentLocalOfferAnswer = InviteSession::makeOfferAnswer(answer); break; @@ -840,7 +840,7 @@ InviteSession::targetRefresh(const NameAddr& localUri) void InviteSession::refer(const NameAddr& referTo, bool referSub) { - refer(referTo,std::unique_ptr(0),referSub); + refer(referTo, std::unique_ptr(nullptr),referSub); } void InviteSession::refer(const NameAddr& referTo, std::unique_ptr contents,bool referSub) @@ -852,7 +852,7 @@ InviteSession::refer(const NameAddr& referTo, std::unique_ptr c refer->header(h_ReferTo) = referTo; refer->header(h_ReferredBy) = myAddr(); refer->header(h_ReferredBy).remove(p_tag); // tag-param not permitted in rfc3892; not the same as generic-param - refer->setContents(contents); + refer->setContents(std::move(contents)); if (!referSub) { refer->header(h_ReferSub).value() = "false"; @@ -938,7 +938,7 @@ InviteSession::referCommand(const NameAddr& referTo, bool referSub) void InviteSession::refer(const NameAddr& referTo, InviteSessionHandle sessionToReplace, bool referSub) { - refer(referTo,sessionToReplace,std::unique_ptr(0),referSub); + refer(referTo,sessionToReplace, std::unique_ptr(nullptr),referSub); } void @@ -955,13 +955,13 @@ InviteSession::refer(const NameAddr& referTo, InviteSessionHandle sessionToRepla replaces.param(p_toTag) = id.getRemoteTag(); replaces.param(p_fromTag) = id.getLocalTag(); - refer(referTo, replaces, contents, referSub); + refer(referTo, replaces, std::move(contents), referSub); } void InviteSession::refer(const NameAddr& referTo, const CallId& replaces, bool referSub) { - refer(referTo,replaces,std::unique_ptr(0),referSub); + refer(referTo, replaces, std::unique_ptr(nullptr), referSub); } void @@ -971,7 +971,7 @@ InviteSession::refer(const NameAddr& referTo, const CallId& replaces, std::uniqu { SharedPtr refer(new SipMessage()); mDialog.makeRequest(*refer, REFER); - refer->setContents(contents); + refer->setContents(std::move(contents)); refer->header(h_ReferTo) = referTo; refer->header(h_ReferredBy) = myAddr(); refer->header(h_ReferredBy).remove(p_tag); @@ -1381,7 +1381,7 @@ InviteSession::dispatchConnected(const SipMessage& msg) *mLastRemoteSessionModification = msg; transition(ReceivedReinvite); mCurrentEncryptionLevel = getEncryptionLevel(msg); - mProposedRemoteOfferAnswer = offerAnswer; + mProposedRemoteOfferAnswer = std::move(offerAnswer); handler->onOffer(getSessionHandle(), msg, *mProposedRemoteOfferAnswer); break; @@ -1402,7 +1402,7 @@ InviteSession::dispatchConnected(const SipMessage& msg) // See rfc3311 5.2, 4th paragraph. *mLastRemoteSessionModification = msg; mCurrentEncryptionLevel = getEncryptionLevel(msg); - mProposedRemoteOfferAnswer = offerAnswer; + mProposedRemoteOfferAnswer = std::move(offerAnswer); handler->onOffer(getSessionHandle(), msg, *mProposedRemoteOfferAnswer); break; @@ -1466,7 +1466,7 @@ InviteSession::dispatchSentUpdate(const SipMessage& msg) mCurrentEncryptionLevel = getEncryptionLevel(msg); setCurrentLocalOfferAnswer(msg); - mCurrentRemoteOfferAnswer = offerAnswer; + mCurrentRemoteOfferAnswer = std::move(offerAnswer); handler->onAnswer(getSessionHandle(), msg, *mCurrentRemoteOfferAnswer); } else if(mProposedLocalOfferAnswer.get()) @@ -1569,13 +1569,13 @@ InviteSession::dispatchSentReinvite(const SipMessage& msg) if (changed) { - mCurrentRemoteOfferAnswer = offerAnswer; + mCurrentRemoteOfferAnswer = std::move(offerAnswer); handler->onRemoteAnswerChanged(getSessionHandle(), msg, *mCurrentRemoteOfferAnswer); } } else { - mCurrentRemoteOfferAnswer = offerAnswer; + mCurrentRemoteOfferAnswer = std::move(offerAnswer); handler->onAnswer(getSessionHandle(), msg, *mCurrentRemoteOfferAnswer); } @@ -1674,7 +1674,7 @@ InviteSession::dispatchSentReinviteNoOffer(const SipMessage& msg) handleSessionTimerResponse(msg); // mLastSessionModification = msg; // ?slg? why are we storing 200's? mCurrentEncryptionLevel = getEncryptionLevel(msg); - mProposedRemoteOfferAnswer = offerAnswer; + mProposedRemoteOfferAnswer = std::move(offerAnswer); handler->onOffer(getSessionHandle(), msg, *mProposedRemoteOfferAnswer); break; } @@ -1758,7 +1758,7 @@ InviteSession::dispatchReceivedReinviteSentOffer(const SipMessage& msg) case OnAckAnswer: transition(Connected); setCurrentLocalOfferAnswer(msg); - mCurrentRemoteOfferAnswer = offerAnswer; + mCurrentRemoteOfferAnswer = std::move(offerAnswer); mCurrentEncryptionLevel = getEncryptionLevel(msg); mCurrentRetransmit200 = 0; // stop the 200 retransmit timer diff --git a/src/libs/resiprocate/resip/dum/InviteSession.hxx b/src/libs/resiprocate/resip/dum/InviteSession.hxx index 9fdda3c6..024c23d2 100644 --- a/src/libs/resiprocate/resip/dum/InviteSession.hxx +++ b/src/libs/resiprocate/resip/dum/InviteSession.hxx @@ -78,13 +78,13 @@ class InviteSession : public DialogUsage /** sends a refer request */ virtual void refer(const NameAddr& referTo, bool referSub = true); - virtual void refer(const NameAddr& referTo, std::auto_ptr contents, bool referSub = true); + virtual void refer(const NameAddr& referTo, std::unique_ptr contents, bool referSub = true); /** sends a refer request with a replaces header */ virtual void refer(const NameAddr& referTo, InviteSessionHandle sessionToReplace, bool referSub = true); - virtual void refer(const NameAddr& referTo, InviteSessionHandle sessionToReplace, std::auto_ptr contents, bool referSub = true); + virtual void refer(const NameAddr& referTo, InviteSessionHandle sessionToReplace, std::unique_ptr contents, bool referSub = true); virtual void refer(const NameAddr& referTo, const CallId& replaces, bool referSub = true); - virtual void refer(const NameAddr& referTo, const CallId& replaces, std::auto_ptr contents, bool referSub = true); + virtual void refer(const NameAddr& referTo, const CallId& replaces, std::unique_ptr contents, bool referSub = true); /** sends an info request */ virtual void info(const Contents& contents); @@ -320,10 +320,10 @@ class InviteSession : public DialogUsage static Data toData(State state); void transition(State target); - std::auto_ptr getOfferAnswer(const SipMessage& msg); + std::unique_ptr getOfferAnswer(const SipMessage& msg); bool isReliable(const SipMessage& msg); - static std::auto_ptr makeOfferAnswer(const Contents& offerAnswer); - static std::auto_ptr makeOfferAnswer(const Contents& offerAnswer, const Contents* alternative); + static std::unique_ptr makeOfferAnswer(const Contents& offerAnswer); + static std::unique_ptr makeOfferAnswer(const Contents& offerAnswer, const Contents* alternative); static void setOfferAnswer(SipMessage& msg, const Contents& offerAnswer, const Contents* alternative = 0); static void setOfferAnswer(SipMessage& msg, const Contents* offerAnswer); void provideProposedOffer(); @@ -355,11 +355,11 @@ class InviteSession : public DialogUsage NitState mNitState; NitState mServerNitState; - std::auto_ptr mCurrentLocalOfferAnswer; - std::auto_ptr mProposedLocalOfferAnswer; + std::unique_ptr mCurrentLocalOfferAnswer; + std::unique_ptr mProposedLocalOfferAnswer; - std::auto_ptr mCurrentRemoteOfferAnswer; - std::auto_ptr mProposedRemoteOfferAnswer; + std::unique_ptr mCurrentRemoteOfferAnswer; + std::unique_ptr mProposedRemoteOfferAnswer; SharedPtr mLastLocalSessionModification; // last UPDATE or reINVITE sent SharedPtr mLastRemoteSessionModification; // last UPDATE or reINVITE received diff --git a/src/libs/resiprocate/resip/dum/InviteSessionCreator.cxx b/src/libs/resiprocate/resip/dum/InviteSessionCreator.cxx index 3dfb551d..5e16d167 100644 --- a/src/libs/resiprocate/resip/dum/InviteSessionCreator.cxx +++ b/src/libs/resiprocate/resip/dum/InviteSessionCreator.cxx @@ -51,7 +51,7 @@ InviteSessionCreator::InviteSessionCreator(DialogUsageManager& dum, { initialOffer.reset(initial->clone()); } - getLastRequest()->setContents(initialOffer); + getLastRequest()->setContents(std::move(initialOffer)); } //100rel switch(mDum.getMasterProfile()->getUacReliableProvisionalMode()) diff --git a/src/libs/resiprocate/resip/dum/OutgoingEvent.hxx b/src/libs/resiprocate/resip/dum/OutgoingEvent.hxx index 12ab9b9b..41b08e78 100644 --- a/src/libs/resiprocate/resip/dum/OutgoingEvent.hxx +++ b/src/libs/resiprocate/resip/dum/OutgoingEvent.hxx @@ -12,7 +12,7 @@ namespace resip class OutgoingEvent : public Message { public: - //OutgoingEvent(std::auto_ptr msg); + //OutgoingEvent(std::unique_ptr msg); OutgoingEvent(SharedPtr msg); OutgoingEvent(const OutgoingEvent&); ~OutgoingEvent(); @@ -27,7 +27,7 @@ class OutgoingEvent : public Message virtual EncodeStream& encodeBrief(EncodeStream& strm) const; private: - //mutable std::auto_ptr mMessage; + //mutable std::unique_ptr mMessage; SharedPtr mMessage; }; diff --git a/src/libs/resiprocate/resip/dum/PagerMessageHandler.hxx b/src/libs/resiprocate/resip/dum/PagerMessageHandler.hxx index cfd154d1..e37a3fe5 100644 --- a/src/libs/resiprocate/resip/dum/PagerMessageHandler.hxx +++ b/src/libs/resiprocate/resip/dum/PagerMessageHandler.hxx @@ -22,7 +22,7 @@ class ClientPagerMessageHandler virtual void onSuccess(ClientPagerMessageHandle, const SipMessage& status)=0; //!kh! // Application could re-page the failed contents or just ingore it. - virtual void onFailure(ClientPagerMessageHandle, const SipMessage& status, std::auto_ptr contents)=0; + virtual void onFailure(ClientPagerMessageHandle, const SipMessage& status, std::unique_ptr contents)=0; }; class ServerPagerMessageHandler diff --git a/src/libs/resiprocate/resip/dum/RegistrationHandler.hxx b/src/libs/resiprocate/resip/dum/RegistrationHandler.hxx index 9d3a4894..2f1cc916 100644 --- a/src/libs/resiprocate/resip/dum/RegistrationHandler.hxx +++ b/src/libs/resiprocate/resip/dum/RegistrationHandler.hxx @@ -102,8 +102,8 @@ class ServerRegistrationHandler */ virtual void asyncUpdateContacts(ServerRegistrationHandle, const Uri& aor, - std::auto_ptr modifiedContactList, - std::auto_ptr transactionLog) + std::unique_ptr modifiedContactList, + std::unique_ptr transactionLog) { } @@ -112,7 +112,7 @@ class ServerRegistrationHandler */ virtual void asyncRemoveExpired(ServerRegistrationHandle, const resip::Uri& aor, - std::auto_ptr contacts) + std::unique_ptr contacts) { } }; diff --git a/src/libs/resiprocate/resip/dum/ServerAuthManager.cxx b/src/libs/resiprocate/resip/dum/ServerAuthManager.cxx index c056f5bf..a7ecb08a 100644 --- a/src/libs/resiprocate/resip/dum/ServerAuthManager.cxx +++ b/src/libs/resiprocate/resip/dum/ServerAuthManager.cxx @@ -88,7 +88,7 @@ ServerAuthManager::process(Message* msg) else { // challenge is not required, re-instate original message - postCommand(unique_ptr(sipMsg)); + postCommand(std::move(sipMsg)); return FeatureDoneAndEventDone; } } diff --git a/src/libs/resiprocate/resip/dum/ServerInviteSession.cxx b/src/libs/resiprocate/resip/dum/ServerInviteSession.cxx index 2c2d982b..ca377f0c 100644 --- a/src/libs/resiprocate/resip/dum/ServerInviteSession.cxx +++ b/src/libs/resiprocate/resip/dum/ServerInviteSession.cxx @@ -323,13 +323,13 @@ ServerInviteSession::provideAnswer(const Contents& answer) { case UAS_Offer: transition(UAS_OfferProvidedAnswer); - mCurrentRemoteOfferAnswer = mProposedRemoteOfferAnswer; + mCurrentRemoteOfferAnswer = std::move(mProposedRemoteOfferAnswer); mCurrentLocalOfferAnswer = InviteSession::makeOfferAnswer(answer); break; case UAS_EarlyOffer: transition(UAS_EarlyProvidedAnswer); - mCurrentRemoteOfferAnswer = mProposedRemoteOfferAnswer; + mCurrentRemoteOfferAnswer = std::move(mProposedRemoteOfferAnswer); mCurrentLocalOfferAnswer = InviteSession::makeOfferAnswer(answer); break; diff --git a/src/libs/resiprocate/resip/dum/ServerRegistration.cxx b/src/libs/resiprocate/resip/dum/ServerRegistration.cxx index febb5276..60d2e332 100644 --- a/src/libs/resiprocate/resip/dum/ServerRegistration.cxx +++ b/src/libs/resiprocate/resip/dum/ServerRegistration.cxx @@ -117,7 +117,7 @@ ServerRegistration::accept(SipMessage& ok) mAsyncLocalStore->releaseLog(log,modifiedContacts); mAsyncOkMsg = SharedPtr(static_cast(ok.clone())); - mDum.mServerRegistrationHandler->asyncUpdateContacts(getHandle(),mAor,modifiedContacts,log); + mDum.mServerRegistrationHandler->asyncUpdateContacts(getHandle(), mAor, std::move(modifiedContacts), std::move(log)); //!WARN! Must not access this object beyond this point. The client my call reject() or accept(), deleting this object. Also, watch out for local objects that are still in scope and access this object on destruction. return; } @@ -642,7 +642,7 @@ ServerRegistration::asyncProcessFinalOkMsg(SipMessage &msg, ContactPtrList &cont if (expired.get() && expired->size() > 0) { - mDum.mServerRegistrationHandler->asyncRemoveExpired(getHandle(),mAor,expired); + mDum.mServerRegistrationHandler->asyncRemoveExpired(getHandle(), mAor, std::move(expired)); //!WARN! Must not access this object beyond this point. The client my call reject() or accept(), deleting this object. Also, watch out for local objects that are still in scope and access this object on destruction. return; } @@ -684,7 +684,7 @@ ServerRegistration::asyncProvideContacts(std::unique_ptr case asyncStateWaitingForInitialContactList: { assert(mAsyncLocalStore.get() == 0); - mAsyncLocalStore = resip::SharedPtr(new AsyncLocalStore(contacts)); + mAsyncLocalStore = resip::SharedPtr(new AsyncLocalStore(std::move(contacts))); mAsyncState = asyncStateProcessingRegistration; processRegistration(mRequest); break; @@ -697,7 +697,7 @@ ServerRegistration::asyncProvideContacts(std::unique_ptr case asyncStateAcceptedWaitingForFinalContactList: { mAsyncState = asyncStateProvidedFinalContacts; - asyncProcessFinalContacts(contacts); + asyncProcessFinalContacts(std::move(contacts)); break; } default: @@ -734,7 +734,7 @@ ServerRegistration::asyncProcessFinalContacts(std::unique_ptr originalContacts) { - mModifiedContacts = originalContacts; + mModifiedContacts = std::move(originalContacts); mLog = std::unique_ptr(new ContactRecordTransactionLog()); } diff --git a/src/libs/resiprocate/resip/dum/ServerRegistration.hxx b/src/libs/resiprocate/resip/dum/ServerRegistration.hxx index dc11b03d..77411b69 100644 --- a/src/libs/resiprocate/resip/dum/ServerRegistration.hxx +++ b/src/libs/resiprocate/resip/dum/ServerRegistration.hxx @@ -47,7 +47,7 @@ class ServerRegistration: public NonDialogUsage !CAUTION! This function must be called from the DUM thread. */ - bool asyncProvideContacts(std::auto_ptr contacts); + bool asyncProvideContacts(std::unique_ptr contacts); resip::SharedPtr getOriginalContacts() { return mOriginalContacts; } // WARNING - use this only if async mode is not used const ContactList& getRequestContacts() { return mRequestContacts; } @@ -132,7 +132,7 @@ class ServerRegistration: public NonDialogUsage * contact list. Once the final list is received via asyncProvideContacts(), this function finishes the REGISTER * processing. */ - void asyncProcessFinalContacts(std::auto_ptr contacts); + void asyncProcessFinalContacts(std::unique_ptr contacts); /** Local datastore used to aggregate all changes to the current contact list when using the asynchronous logic. */ @@ -140,9 +140,9 @@ class ServerRegistration: public NonDialogUsage { public: - AsyncLocalStore(std::auto_ptr originalContacts) + AsyncLocalStore(std::unique_ptr originalContacts) { - create(originalContacts); + create(std::move(originalContacts)); } ~AsyncLocalStore(void) @@ -153,7 +153,7 @@ class ServerRegistration: public NonDialogUsage /** Setup this object in preparation for updating the records. Updates occur when processing a REGISTER message. */ - void create(std::auto_ptr originalContacts); + void create(std::unique_ptr originalContacts); void destroy(void); @@ -170,16 +170,16 @@ class ServerRegistration: public NonDialogUsage /** Remove the transacation log and updated contact list. This object should be considered destroyed and not used after releasing. */ - void releaseLog(std::auto_ptr &log, std::auto_ptr &modifiedContacts) + void releaseLog(std::unique_ptr &log, std::unique_ptr &modifiedContacts) { - log = mLog; - modifiedContacts = mModifiedContacts; + log = std::move(mLog); + modifiedContacts = std::move(mModifiedContacts); } unsigned int numContacts() { if(mModifiedContacts.get()) return (unsigned int)mModifiedContacts->size(); return 0; } private: - std::auto_ptr mLog; - std::auto_ptr mModifiedContacts; + std::unique_ptr mLog; + std::unique_ptr mModifiedContacts; }; resip::SharedPtr mAsyncLocalStore; diff --git a/src/libs/resiprocate/resip/dum/TargetCommand.cxx b/src/libs/resiprocate/resip/dum/TargetCommand.cxx index 52289020..7b15babf 100644 --- a/src/libs/resiprocate/resip/dum/TargetCommand.cxx +++ b/src/libs/resiprocate/resip/dum/TargetCommand.cxx @@ -9,19 +9,19 @@ using namespace std; TargetCommand::TargetCommand(Target& target, unique_ptr message) : mTarget(target), - mMessage(message) + mMessage(std::move(message)) { } TargetCommand::TargetCommand(const TargetCommand& from) : mTarget(from.mTarget), - mMessage(from.mMessage) + mMessage(std::move(from.mMessage)) { } void TargetCommand::executeCommand() { - mTarget.post(mMessage); + mTarget.post(std::move(mMessage)); } Message* TargetCommand::clone() const diff --git a/src/libs/resiprocate/resip/dum/TargetCommand.hxx b/src/libs/resiprocate/resip/dum/TargetCommand.hxx index e980796a..6ab70c76 100644 --- a/src/libs/resiprocate/resip/dum/TargetCommand.hxx +++ b/src/libs/resiprocate/resip/dum/TargetCommand.hxx @@ -19,13 +19,13 @@ class TargetCommand : public DumCommand { } virtual ~Target()=0; - virtual void post(std::auto_ptr)=0; + virtual void post(std::unique_ptr)=0; protected: DialogUsageManager& mDum; }; - TargetCommand(Target& target, std::auto_ptr message); + TargetCommand(Target& target, std::unique_ptr message); TargetCommand(const TargetCommand&); void executeCommand(); @@ -36,7 +36,7 @@ class TargetCommand : public DumCommand private: Target& mTarget; - mutable std::auto_ptr mMessage; + mutable std::unique_ptr mMessage; }; } diff --git a/src/libs/resiprocate/resip/dum/ssl/EncryptionManager.cxx b/src/libs/resiprocate/resip/dum/ssl/EncryptionManager.cxx index a7b11252..aba249fb 100644 --- a/src/libs/resiprocate/resip/dum/ssl/EncryptionManager.cxx +++ b/src/libs/resiprocate/resip/dum/ssl/EncryptionManager.cxx @@ -287,7 +287,7 @@ bool EncryptionManager::decrypt(SipMessage* msg) { if (csa.mContents.get()) { - msg->setContents(csa.mContents); + msg->setContents(std::move(csa.mContents)); if (csa.mAttributes.get()) { @@ -298,7 +298,7 @@ bool EncryptionManager::decrypt(SipMessage* msg) { csa.mAttributes->setIdentityStrength(origSecurityAttributes->getIdentityStrength()); } - msg->setSecurityAttributes(csa.mAttributes); + msg->setSecurityAttributes(std::move(csa.mAttributes)); } } else @@ -855,11 +855,11 @@ EncryptionManager::Result EncryptionManager::Decrypt::received(bool success, if (csa.mContents.get()) { csa.mContents->checkParsed(); - mMsgToDecrypt->setContents(csa.mContents); + mMsgToDecrypt->setContents(std::move(csa.mContents)); if (csa.mAttributes.get()) { - mMsgToDecrypt->setSecurityAttributes(csa.mAttributes); + mMsgToDecrypt->setSecurityAttributes(std::move(csa.mAttributes)); } } else @@ -1129,7 +1129,7 @@ Helper::ContentsSecAttrs EncryptionManager::Decrypt::getContents(SipMessage* mes std::unique_ptr c(contents); std::unique_ptr a(attr); - return Helper::ContentsSecAttrs(c, a); + return Helper::ContentsSecAttrs(std::move(c), std::move(a)); } Contents* EncryptionManager::Decrypt::getContentsRecurse(Contents** tree, diff --git a/src/libs/resiprocate/resip/dum/ssl/EncryptionManager.hxx b/src/libs/resiprocate/resip/dum/ssl/EncryptionManager.hxx index 10015e89..95b45c4d 100644 --- a/src/libs/resiprocate/resip/dum/ssl/EncryptionManager.hxx +++ b/src/libs/resiprocate/resip/dum/ssl/EncryptionManager.hxx @@ -35,7 +35,7 @@ class EncryptionManager : public DumFeature EncryptionManager(DialogUsageManager& dum, TargetCommand::Target& target); virtual ~EncryptionManager(); - void setRemoteCertStore(std::auto_ptr store); + void setRemoteCertStore(std::unique_ptr store); virtual DumFeature::ProcessingResult process(Message* msg); private: @@ -143,7 +143,7 @@ class EncryptionManager : public DumFeature bool mMessageTaken; }; - std::auto_ptr mRemoteCertStore; + std::unique_ptr mRemoteCertStore; typedef std::list RequestList; RequestList mRequests; diff --git a/src/libs/resiprocate/resip/recon/RemoteParticipant.hxx b/src/libs/resiprocate/resip/recon/RemoteParticipant.hxx index 0238ccda..7c3004e4 100644 --- a/src/libs/resiprocate/resip/recon/RemoteParticipant.hxx +++ b/src/libs/resiprocate/resip/recon/RemoteParticipant.hxx @@ -180,7 +180,7 @@ private: resip::InviteSessionHandle mDestInviteSessionHandle; }; PendingRequest mPendingRequest; - std::auto_ptr mPendingOffer; + std::unique_ptr mPendingOffer; sdpcontainer::Sdp* mLocalSdp; sdpcontainer::Sdp* mRemoteSdp; diff --git a/src/libs/resiprocate/resip/recon/RemoteParticipantDialogSet.hxx b/src/libs/resiprocate/resip/recon/RemoteParticipantDialogSet.hxx index 2474a68d..bd25e42c 100644 --- a/src/libs/resiprocate/resip/recon/RemoteParticipantDialogSet.hxx +++ b/src/libs/resiprocate/resip/recon/RemoteParticipantDialogSet.hxx @@ -83,8 +83,8 @@ public: void processMediaStreamErrorEvent(unsigned int errorCode); void sendInvite(resip::SharedPtr invite); - void provideOffer(std::auto_ptr offer, resip::InviteSessionHandle& inviteSessionHandle, bool postOfferAccept); - void provideAnswer(std::auto_ptr answer, resip::InviteSessionHandle& inviteSessionHandle, bool postAnswerAccept, bool postAnswerAlert); + void provideOffer(std::unique_ptr offer, resip::InviteSessionHandle& inviteSessionHandle, bool postOfferAccept); + void provideAnswer(std::unique_ptr answer, resip::InviteSessionHandle& inviteSessionHandle, bool postAnswerAccept, bool postAnswerAlert); void accept(resip::InviteSessionHandle& inviteSessionHandle); ConversationProfile::SecureMediaMode getSecureMediaMode() { return mSecureMediaMode; } flowmanager::MediaStream::SrtpCryptoSuite getSrtpCryptoSuite() { return mSrtpCryptoSuite; } @@ -123,13 +123,13 @@ private: public: PendingOfferAnswer() {} bool mOffer; - std::auto_ptr mSdp; + std::unique_ptr mSdp; resip::InviteSessionHandle mInviteSessionHandle; bool mPostOfferAnswerAccept; bool mPostAnswerAlert; }; PendingOfferAnswer mPendingOfferAnswer; - void doProvideOfferAnswer(bool offer, std::auto_ptr sdp, resip::InviteSessionHandle& inviteSessionHandle, bool postOfferAnswerAccept, bool postAnswerAlert); + void doProvideOfferAnswer(bool offer, std::unique_ptr sdp, resip::InviteSessionHandle& inviteSessionHandle, bool postOfferAnswerAccept, bool postAnswerAlert); sdpcontainer::Sdp* mProposedSdp; // stored here vs RemoteParticipant, since each forked leg needs access to the original offer // Secure Media diff --git a/src/libs/resiprocate/resip/stack/ConnectionBase.cxx b/src/libs/resiprocate/resip/stack/ConnectionBase.cxx index 512fb48c..f6e5f58a 100644 --- a/src/libs/resiprocate/resip/stack/ConnectionBase.cxx +++ b/src/libs/resiprocate/resip/stack/ConnectionBase.cxx @@ -406,7 +406,7 @@ ConnectionBase::preparseNewBytes(int bytesRead) std::unique_ptr tryLater(transport()->make503(*mMessage, expectedWait/1000)); if(tryLater.get()) { - transport()->send(tryLater); + transport()->send(std::move(tryLater)); } delete mMessage; // dropping message due to congestion mMessage = 0; @@ -481,7 +481,7 @@ ConnectionBase::preparseNewBytes(int bytesRead) std::unique_ptr tryLater = transport()->make503(*mMessage, expectedWait/1000); if(tryLater.get()) { - transport()->send(tryLater); + transport()->send(std::move(tryLater)); } delete mMessage; // dropping message due to congestion mMessage = 0; diff --git a/src/libs/resiprocate/resip/stack/Helper.cxx b/src/libs/resiprocate/resip/stack/Helper.cxx index 72ce4ccf..6919705b 100644 --- a/src/libs/resiprocate/resip/stack/Helper.cxx +++ b/src/libs/resiprocate/resip/stack/Helper.cxx @@ -1860,21 +1860,21 @@ Helper::fromGruuUserPart(const Data& gruuUserPart, } #endif Helper::ContentsSecAttrs::ContentsSecAttrs() - : mContents(0), - mAttributes(0) + : mContents(nullptr), + mAttributes(nullptr) {} Helper::ContentsSecAttrs::ContentsSecAttrs(std::unique_ptr contents, std::unique_ptr attributes) - : mContents(contents), - mAttributes(attributes) + : mContents(std::move(contents)), + mAttributes(std::move(attributes)) {} // !!bwc!! Yikes! Destructive copy c'tor! Are we _sure_ this is the // intended behavior? Helper::ContentsSecAttrs::ContentsSecAttrs(const ContentsSecAttrs& rhs) - : mContents(rhs.mContents), - mAttributes(rhs.mAttributes) + : mContents(std::move(rhs.mContents)), + mAttributes(std::move(rhs.mAttributes)) {} Helper::ContentsSecAttrs& @@ -1884,8 +1884,8 @@ Helper::ContentsSecAttrs::operator=(const ContentsSecAttrs& rhs) { // !!bwc!! Yikes! Destructive assignment operator! Are we _sure_ this is // the intended behavior? - mContents = rhs.mContents; - mAttributes = rhs.mAttributes; + mContents = std::move(rhs.mContents); + mAttributes = std::move(rhs.mAttributes); } return *this; } @@ -1992,7 +1992,7 @@ Helper::extractFromPkcs7(const SipMessage& message, } std::unique_ptr c(b); std::unique_ptr a(attr); - return ContentsSecAttrs(c, a); + return ContentsSecAttrs(std::move(c), std::move(a)); } Helper::FailureMessageEffect @@ -2176,7 +2176,7 @@ unique_ptr Helper::getSdp(Contents* tree) } //DebugLog(<< "No sdp" << endl); - return emptysdp; + return std::unique_ptr(); } bool diff --git a/src/libs/resiprocate/resip/stack/Helper.hxx b/src/libs/resiprocate/resip/stack/Helper.hxx index 2a3c7ac1..0a297ccc 100644 --- a/src/libs/resiprocate/resip/stack/Helper.hxx +++ b/src/libs/resiprocate/resip/stack/Helper.hxx @@ -526,12 +526,12 @@ class Helper struct ContentsSecAttrs { ContentsSecAttrs(); - ContentsSecAttrs(std::auto_ptr contents, - std::auto_ptr attributes); + ContentsSecAttrs(std::unique_ptr contents, + std::unique_ptr attributes); ContentsSecAttrs(const ContentsSecAttrs& rhs); ContentsSecAttrs& operator=(const ContentsSecAttrs& rhs); - mutable std::auto_ptr mContents; - mutable std::auto_ptr mAttributes; + mutable std::unique_ptr mContents; + mutable std::unique_ptr mAttributes; }; static ContentsSecAttrs extractFromPkcs7(const SipMessage& message, Security& security); @@ -544,7 +544,7 @@ class Helper // Just simply walk the contents tree and return the first SdpContents in // the tree. - static std::auto_ptr getSdp(Contents* tree); + static std::unique_ptr getSdp(Contents* tree); /** Looks at SIP headers and message source for a mismatch to make an assumption that the sender is behind a NAT device. diff --git a/src/libs/resiprocate/resip/stack/InternalTransport.hxx b/src/libs/resiprocate/resip/stack/InternalTransport.hxx index bbe8a178..924c335e 100644 --- a/src/libs/resiprocate/resip/stack/InternalTransport.hxx +++ b/src/libs/resiprocate/resip/stack/InternalTransport.hxx @@ -75,7 +75,7 @@ public: // used for statistics virtual unsigned int getFifoSize() const; - virtual void send(std::auto_ptr data); + virtual void send(std::unique_ptr data); virtual void poke(); // .bwc. This needs to be overridden if this transport runs in its own diff --git a/src/libs/resiprocate/resip/stack/SipMessage.cxx b/src/libs/resiprocate/resip/stack/SipMessage.cxx index b8fd8151..c540054f 100644 --- a/src/libs/resiprocate/resip/stack/SipMessage.cxx +++ b/src/libs/resiprocate/resip/stack/SipMessage.cxx @@ -1024,20 +1024,20 @@ SipMessage::setContents(const Contents* contents) } else { - setContents(unique_ptr(0)); + setContents(unique_ptr(nullptr)); } } Contents* SipMessage::getContents() const { - if (mContents == 0 && mContentsHfv.getBuffer() != 0) + if (mContents == nullptr && mContentsHfv.getBuffer() != nullptr) { if (empty(h_ContentType) || !const_header(h_ContentType).isWellFormed()) { StackLog(<< "SipMessage::getContents: ContentType header does not exist - implies no contents"); - return 0; + return nullptr; } DebugLog(<< "SipMessage::getContents: " << const_header(h_ContentType).type() @@ -1087,12 +1087,12 @@ SipMessage::releaseContents() { Contents* c=getContents(); // .bwc. unique_ptr owns the Contents. No other references allowed! - unique_ptr ret(c ? c->clone() : 0); - setContents(std::unique_ptr(0)); + unique_ptr ret(c ? c->clone() : nullptr); + setContents(std::unique_ptr(nullptr)); if (ret.get() != 0 && !ret->isWellFormed()) { - ret.reset(0); + ret.reset(nullptr); } return ret; @@ -1108,7 +1108,7 @@ SipMessage::header(const ExtensionHeader& headerName) const if (isEqualNoCase(i->first, headerName.getName())) { HeaderFieldValueList* hfvs = i->second; - if (hfvs->getParserContainer() == 0) + if (hfvs->getParserContainer() == nullptr) { SipMessage* nc_this(const_cast(this)); hfvs->setParserContainer(nc_this->makeParserContainer(hfvs, Headers::RESIP_DO_NOT_USE)); @@ -1694,7 +1694,7 @@ SipMessage::mergeUri(const Uri& source) void SipMessage::setSecurityAttributes(unique_ptr sec) { - mSecurityAttributes = sec; + mSecurityAttributes = std::move(sec); } void @@ -1746,7 +1746,7 @@ SipMessage::copyOutboundDecoratorsToStackCancel(SipMessage& cancel) { if((*i)->copyToStackCancels()) { - cancel.addOutboundDecorator(*(new unique_ptr((*i)->clone()))); + cancel.addOutboundDecorator(std::move(*(new unique_ptr((*i)->clone())))); } } } @@ -1760,7 +1760,7 @@ SipMessage::copyOutboundDecoratorsToStackFailureAck(SipMessage& ack) { if((*i)->copyToStackFailureAcks()) { - ack.addOutboundDecorator(*(new unique_ptr((*i)->clone()))); + ack.addOutboundDecorator(std::move(*(new unique_ptr((*i)->clone())))); } } } diff --git a/src/libs/resiprocate/resip/stack/SipStack.cxx b/src/libs/resiprocate/resip/stack/SipStack.cxx index 56bad5cd..d2296f4e 100644 --- a/src/libs/resiprocate/resip/stack/SipStack.cxx +++ b/src/libs/resiprocate/resip/stack/SipStack.cxx @@ -420,7 +420,7 @@ SipStack::addTransport(std::unique_ptr transport) } } mPorts.insert(transport->port()); - mTransactionController->transportSelector().addTransport(transport,true); + mTransactionController->transportSelector().addTransport(std::move(transport), true); } Fifo& @@ -682,7 +682,7 @@ SipStack::post(std::unique_ptr message, unsigned int secondsLater, TransactionUser* tu) { - postMS(message, secondsLater*1000, tu); + postMS(std::move(message), secondsLater*1000, tu); } diff --git a/src/libs/resiprocate/resip/stack/SipStack.hxx b/src/libs/resiprocate/resip/stack/SipStack.hxx index 5dfe9a91..eaf73b9f 100644 --- a/src/libs/resiprocate/resip/stack/SipStack.hxx +++ b/src/libs/resiprocate/resip/stack/SipStack.hxx @@ -322,7 +322,7 @@ class SipStack : public FdSetIOObserver @param transport Pointer to an externally created transport. SipStack assumes ownership. */ - void addTransport( std::auto_ptr transport); + void addTransport( std::unique_ptr transport); /** Returns the fifo that subclasses of Transport should use for the rxFifo @@ -397,14 +397,14 @@ class SipStack : public FdSetIOObserver */ void send(const SipMessage& msg, TransactionUser* tu=0); - void send(std::auto_ptr msg, TransactionUser* tu = 0); + void send(std::unique_ptr msg, TransactionUser* tu = 0); /** @brief this is only if you want to send to a destination not in the route. @note You probably don't want to use it. */ - void sendTo(std::auto_ptr msg, const Uri& uri, TransactionUser* tu=0); + void sendTo(std::unique_ptr msg, const Uri& uri, TransactionUser* tu=0); /** @brief this is only if you want to send to a destination not in the route. @note You probably don't want to use it. */ - void sendTo(std::auto_ptr msg, const Tuple& tuple, TransactionUser* tu=0); + void sendTo(std::unique_ptr msg, const Tuple& tuple, TransactionUser* tu=0); /** @brief send a message to a destination not in the route @@ -468,7 +468,7 @@ class SipStack : public FdSetIOObserver @param tu TransactionUser to post to. */ - void post(std::auto_ptr message, + void post(std::unique_ptr message, unsigned int secondsLater, TransactionUser* tu=0); @@ -484,7 +484,7 @@ class SipStack : public FdSetIOObserver @param tu TransactionUser to post to. */ - void postMS(const std::auto_ptr message, + void postMS(const std::unique_ptr message, unsigned int ms, TransactionUser* tu=0); @@ -495,7 +495,7 @@ class SipStack : public FdSetIOObserver @param message ApplicationMessage to post */ - void post(std::auto_ptr message); + void post(std::unique_ptr message); /** @brief Makes the message available to the TU later @@ -1050,7 +1050,7 @@ class SipStack : public FdSetIOObserver /** @brief All aspects of the Transaction State Machine / DNS resolver **/ TransactionController* mTransactionController; - std::auto_ptr > mStateMacFifoBuffer; + std::unique_ptr > mStateMacFifoBuffer; TransactionControllerThread* mTransactionControllerThread; TransportSelectorThread* mTransportSelectorThread; diff --git a/src/libs/resiprocate/resip/stack/TransactionState.hxx b/src/libs/resiprocate/resip/stack/TransactionState.hxx index 835ccbd0..2caa86a8 100644 --- a/src/libs/resiprocate/resip/stack/TransactionState.hxx +++ b/src/libs/resiprocate/resip/stack/TransactionState.hxx @@ -161,9 +161,9 @@ class TransactionState : public DnsHandler Tuple mResponseTarget; // used to reply to requests // used when the DnsResult moves to another transport on failure. Only - // used for outgoing stateful, so auto_ptr for space efficiency. - std::auto_ptr mOriginalContact; - std::auto_ptr mOriginalVia; + // used for outgoing stateful, so unique_ptr for space efficiency. + std::unique_ptr mOriginalContact; + std::unique_ptr mOriginalVia; const Data mId; const MethodTypes mMethod; diff --git a/src/libs/resiprocate/resip/stack/Transport.hxx b/src/libs/resiprocate/resip/stack/Transport.hxx index 149c29e5..0ff6d0b7 100644 --- a/src/libs/resiprocate/resip/stack/Transport.hxx +++ b/src/libs/resiprocate/resip/stack/Transport.hxx @@ -144,7 +144,7 @@ class Transport : public FdSetIOObserver */ virtual bool isFinished() const=0; - std::auto_ptr makeSendData( const Tuple& tuple, const Data& data, const Data& tid, const Data &sigcompId = Data::Empty); + std::unique_ptr makeSendData( const Tuple& tuple, const Data& data, const Data& tid, const Data &sigcompId = Data::Empty); /** @todo !bwc! What we do with a SendData is flexible. It might make a @@ -154,7 +154,7 @@ class Transport : public FdSetIOObserver @todo !bch! Should this be protected and not public? !bwc! TransportSelector uses this directly for retransmissions. */ - virtual void send(std::auto_ptr data)=0; + virtual void send(std::unique_ptr data)=0; /** Called when a writer is done adding messages to the TxFifo; this is @@ -263,10 +263,10 @@ class Transport : public FdSetIOObserver void makeFailedResponse(const SipMessage& msg, int responseCode = 400, const char * warning = 0); - std::auto_ptr make503(SipMessage& msg, + std::unique_ptr make503(SipMessage& msg, UInt16 retryAfter); - std::auto_ptr make100(SipMessage& msg); + std::unique_ptr make100(SipMessage& msg); void setRemoteSigcompId(SipMessage&msg, Data& id); // mark the received= and rport parameters if necessary static void stampReceived(SipMessage* request); diff --git a/src/libs/resiprocate/resip/stack/TransportSelector.cxx b/src/libs/resiprocate/resip/stack/TransportSelector.cxx index 0bcc480d..9224446d 100644 --- a/src/libs/resiprocate/resip/stack/TransportSelector.cxx +++ b/src/libs/resiprocate/resip/stack/TransportSelector.cxx @@ -167,7 +167,7 @@ TransportSelector::addTransport(std::unique_ptr autoTransport, { if(immediate) { - addTransportInternal(autoTransport); + addTransportInternal(std::move(autoTransport)); } else { @@ -373,7 +373,7 @@ TransportSelector::checkTransportAddQueue() std::unique_ptr t(mTransportsToAdd.getNext(-1)); while(t.get()) { - addTransportInternal(t); + addTransportInternal(std::move(t)); t.reset(mTransportsToAdd.getNext(0)); } } @@ -1166,7 +1166,7 @@ TransportSelector::transmit(SipMessage* msg, Tuple& target, SendData* sendData) *sendData = *send; } - transport->send(send); + transport->send(std::move(send)); return true; } else diff --git a/src/libs/resiprocate/resip/stack/TransportSelector.hxx b/src/libs/resiprocate/resip/stack/TransportSelector.hxx index 6596f4c1..2f5b9fb4 100644 --- a/src/libs/resiprocate/resip/stack/TransportSelector.hxx +++ b/src/libs/resiprocate/resip/stack/TransportSelector.hxx @@ -88,7 +88,7 @@ class TransportSelector /// Causes transport process loops to be interrupted if there is stuff in /// their transmit fifos. void poke(); - void addTransport( std::auto_ptr transport, bool immediate); + void addTransport( std::unique_ptr transport, bool immediate); DnsResult* createDnsResult(DnsHandler* handler); @@ -135,7 +135,7 @@ class TransportSelector } private: - void addTransportInternal( std::auto_ptr transport); + void addTransportInternal( std::unique_ptr transport); void checkTransportAddQueue(); Connection* findConnection(const Tuple& dest) const; Transport* findTransportBySource(Tuple& src, const SipMessage* msg) const; @@ -244,7 +244,7 @@ class TransportSelector int mAvgBufferSize; Fifo mTransportsToAdd; - std::auto_ptr mSelectInterruptor; + std::unique_ptr mSelectInterruptor; FdPollItemHandle mInterruptorHandle; friend class TestTransportSelector; diff --git a/src/libs/resiprocate/resip/stack/TransportSelectorThread.hxx b/src/libs/resiprocate/resip/stack/TransportSelectorThread.hxx index 29a830d4..a7c1b14c 100644 --- a/src/libs/resiprocate/resip/stack/TransportSelectorThread.hxx +++ b/src/libs/resiprocate/resip/stack/TransportSelectorThread.hxx @@ -47,7 +47,7 @@ class TransportSelectorThread : public ThreadIf protected: TransportSelector& mSelector; - std::auto_ptr mPollGrp; + std::unique_ptr mPollGrp; }; // class TransportSelectorThread diff --git a/src/libs/resiprocate/resip/stack/TransportThread.hxx b/src/libs/resiprocate/resip/stack/TransportThread.hxx index 8090b812..780327d7 100644 --- a/src/libs/resiprocate/resip/stack/TransportThread.hxx +++ b/src/libs/resiprocate/resip/stack/TransportThread.hxx @@ -20,7 +20,7 @@ class TransportThread : public ThreadIf protected: Transport& mTransport; - std::auto_ptr mPollGrp; + std::unique_ptr mPollGrp; }; // class TransportThread } // namespace resip diff --git a/src/libs/resiprocate/resip/stack/UdpTransport.cxx b/src/libs/resiprocate/resip/stack/UdpTransport.cxx index bbfe2778..0a2fd48f 100644 --- a/src/libs/resiprocate/resip/stack/UdpTransport.cxx +++ b/src/libs/resiprocate/resip/stack/UdpTransport.cxx @@ -599,12 +599,12 @@ UdpTransport::processRxParse(char *buffer, int len, Tuple& sender) if(mExternalUnknownDatagramHandler) { unique_ptr datagram(new Data(buffer,len)); - (*mExternalUnknownDatagramHandler)(this,sender,datagram); + (*mExternalUnknownDatagramHandler)(this,sender, std::move(datagram)); } // Idea: consider backing buffer out of message and letting caller reuse it delete message; - message=0; + message = nullptr; return origBufferConsumed; } @@ -643,10 +643,10 @@ UdpTransport::processRxParse(char *buffer, int len, Tuple& sender) std::unique_ptr tryLater(make503(*message, getExpectedWaitForIncoming()/1000)); if(tryLater.get()) { - send(tryLater); + send(std::move(tryLater)); } delete message; // dropping message due to congestion - message = 0; + message = nullptr; return origBufferConsumed; } @@ -654,7 +654,7 @@ UdpTransport::processRxParse(char *buffer, int len, Tuple& sender) { delete message; // cannot use it, so, punt on it... // basicCheck queued any response required - message = 0; + message = nullptr; return origBufferConsumed; } diff --git a/src/libs/resiprocate/resip/stack/UdpTransport.hxx b/src/libs/resiprocate/resip/stack/UdpTransport.hxx index b2513764..4ad574bc 100644 --- a/src/libs/resiprocate/resip/stack/UdpTransport.hxx +++ b/src/libs/resiprocate/resip/stack/UdpTransport.hxx @@ -25,7 +25,7 @@ public: * @param transport contains a pointer to the specific UdpTransport object that * received the unknown packet. * @param unknownDatagram contains the actual contents of unknown data received. */ - virtual void operator()(UdpTransport* transport, const Tuple& source, std::auto_ptr unknownDatagram) = 0; + virtual void operator()(UdpTransport* transport, const Tuple& source, std::unique_ptr unknownDatagram) = 0; }; /** diff --git a/src/libs/resiprocate/resip/stack/ssl/Security.cxx b/src/libs/resiprocate/resip/stack/ssl/Security.cxx index 0597f110..1e08f096 100644 --- a/src/libs/resiprocate/resip/stack/ssl/Security.cxx +++ b/src/libs/resiprocate/resip/stack/ssl/Security.cxx @@ -1903,7 +1903,7 @@ BaseSecurity::checkAndSetIdentity(SipMessage& msg, const Data& certDer) const sec->setIdentity(msg.const_header(h_From).uri().getAor()); sec->setIdentityStrength(SecurityAttributes::FailedIdentity); } - msg.setSecurityAttributes(sec); + msg.setSecurityAttributes(std::move(sec)); } diff --git a/src/libs/resiprocate/rutil/SharedCount.hxx b/src/libs/resiprocate/rutil/SharedCount.hxx index 54e353a8..46d51d3b 100644 --- a/src/libs/resiprocate/rutil/SharedCount.hxx +++ b/src/libs/resiprocate/rutil/SharedCount.hxx @@ -9,7 +9,7 @@ Boost.org */ -#include // std::auto_ptr, std::allocator +#include // std::unique_ptr, std::allocator #include // std::less #include // std::exception #include // std::bad_alloc @@ -239,9 +239,9 @@ public: } } - // auto_ptr is special cased to provide the strong guarantee + // unique_ptr is special cased to provide the strong guarantee template - explicit shared_count(std::auto_ptr & r): pi_(new sp_counted_base_impl< Y *, checked_deleter >(r.get(), checked_deleter())) + explicit shared_count(std::unique_ptr & r): pi_(new sp_counted_base_impl< Y *, checked_deleter >(r.get(), checked_deleter())) { r.release(); } diff --git a/src/libs/resiprocate/rutil/SharedPtr.hxx b/src/libs/resiprocate/rutil/SharedPtr.hxx index 82391e9c..1a7d4f9d 100644 --- a/src/libs/resiprocate/rutil/SharedPtr.hxx +++ b/src/libs/resiprocate/rutil/SharedPtr.hxx @@ -11,7 +11,7 @@ */ #include "rutil/SharedCount.hxx" -#include // for std::auto_ptr +#include // for std::unique_ptr #include // for std::swap #include // for std::less #include // for std::bad_cast @@ -151,7 +151,7 @@ public: } template - explicit SharedPtr(std::auto_ptr & r): px(r.get()), pn() + explicit SharedPtr(std::unique_ptr & r): px(r.get()), pn() { Y * tmp = r.get(); pn = shared_count(r); @@ -167,7 +167,7 @@ public: } template - SharedPtr & operator=(std::auto_ptr & r) + SharedPtr & operator=(std::unique_ptr & r) { this_type(r).swap(*this); return *this; diff --git a/src/libs/resiprocate/rutil/dns/DnsThread.hxx b/src/libs/resiprocate/rutil/dns/DnsThread.hxx index a318049a..c8d5f261 100644 --- a/src/libs/resiprocate/rutil/dns/DnsThread.hxx +++ b/src/libs/resiprocate/rutil/dns/DnsThread.hxx @@ -22,7 +22,7 @@ class DnsThread : public ThreadIf protected: DnsStub& mDnsStub; - std::auto_ptr mPollGrp; + std::unique_ptr mPollGrp; }; // class DnsThread } // namespace resip diff --git a/src/libs/resiprocate/rutil/ssl/SHA1Stream.hxx b/src/libs/resiprocate/rutil/ssl/SHA1Stream.hxx index efad6339..37314d0e 100644 --- a/src/libs/resiprocate/rutil/ssl/SHA1Stream.hxx +++ b/src/libs/resiprocate/rutil/ssl/SHA1Stream.hxx @@ -56,7 +56,7 @@ class SHA1Buffer : public std::streambuf // this adds overhead, two additional new/delete. // could get rid of the overhead if, sizeof(SHA_CTX) and SHA_DIGEST_LENGTH are known and FIXED. // could use pimpl to get rid of one new/delete pair. - std::auto_ptr mContext; + std::unique_ptr mContext; std::vector mBuf; bool mBlown; };