diff --git a/src/engine/endpoint/EP_Account.cpp b/src/engine/endpoint/EP_Account.cpp index 8f69ab7a..33660629 100644 --- a/src/engine/endpoint/EP_Account.cpp +++ b/src/engine/endpoint/EP_Account.cpp @@ -414,7 +414,7 @@ int Account::sendMsg(const std::string& peer, const void* ptr, unsigned length, type = resip::Mime(resip::Data(mime), resip::Data()); resip::ClientPagerMessageHandle msgHandle = mAgent.mDum->makePagerMessage(resip::NameAddr(resip::Data(peer)), mProfile, s); - auto_ptr contentPtr(new resip::PlainContents(resip::Data(std::string((const char*)ptr, length)),type)); + unique_ptr contentPtr(new resip::PlainContents(resip::Data(std::string((const char*)ptr, length)),type)); int result = s->sessionId(); msgHandle->page(contentPtr); diff --git a/src/engine/endpoint/EP_Engine.cpp b/src/engine/endpoint/EP_Engine.cpp index 913b33e7..6c16a852 100644 --- a/src/engine/endpoint/EP_Engine.cpp +++ b/src/engine/endpoint/EP_Engine.cpp @@ -232,7 +232,7 @@ void UserAgent::start() mDum->setMasterProfile(mProfile); mDum->setClientRegistrationHandler(this); - mDum->setClientAuthManager(auto_ptr(new resip::ClientAuthManager())); + mDum->setClientAuthManager(unique_ptr(new resip::ClientAuthManager())); mDum->addClientSubscriptionHandler(resip::Symbols::Presence, this); mDum->addClientSubscriptionHandler(resip::Data("message-summary"), this); @@ -244,7 +244,7 @@ void UserAgent::start() mDum->setClientPagerMessageHandler(this); mDum->setServerPagerMessageHandler(this); - auto_ptr uac_dsf(new ResipSessionFactory(this)); + unique_ptr uac_dsf(new ResipSessionFactory(this)); mDum->setAppDialogSetFactory(uac_dsf); // Fire onStart event if stun is not used or stun server ip is known @@ -1471,7 +1471,7 @@ void UserAgent::onSuccess(resip::ClientPagerMessageHandle h, const resip::SipMes onMessageSent(getAccount(status.header(resip::h_From)), s->sessionId(), s->remoteAddress(), s->tag()); } -void UserAgent::onFailure(resip::ClientPagerMessageHandle h, const resip::SipMessage& status, std::auto_ptr contents) +void UserAgent::onFailure(resip::ClientPagerMessageHandle h, const resip::SipMessage& status, std::unique_ptr contents) { if (!h.isValid()) return; diff --git a/src/libs/resiprocate/resip/dum/ClientAuthExtension.cxx b/src/libs/resiprocate/resip/dum/ClientAuthExtension.cxx index 142db06f..7b256f5f 100644 --- a/src/libs/resiprocate/resip/dum/ClientAuthExtension.cxx +++ b/src/libs/resiprocate/resip/dum/ClientAuthExtension.cxx @@ -2,10 +2,10 @@ using namespace resip; -std::auto_ptr ClientAuthExtension::mInstance = std::auto_ptr(new ClientAuthExtension()); +std::unique_ptr ClientAuthExtension::mInstance = std::unique_ptr(new ClientAuthExtension()); void -ClientAuthExtension::setInstance(std::auto_ptr ext) +ClientAuthExtension::setInstance(std::unique_ptr ext) { mInstance = ext; } diff --git a/src/libs/resiprocate/resip/dum/ClientAuthManager.cxx b/src/libs/resiprocate/resip/dum/ClientAuthManager.cxx index dad6f072..7c4b1130 100644 --- a/src/libs/resiprocate/resip/dum/ClientAuthManager.cxx +++ b/src/libs/resiprocate/resip/dum/ClientAuthManager.cxx @@ -413,7 +413,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::auto_ptr clientAuthDecorator(new ClientAuthDecorator(mIsProxyCredential, mAuth, mCredential, authQop, nonceCountString)); + std::unique_ptr clientAuthDecorator(new ClientAuthDecorator(mIsProxyCredential, mAuth, mCredential, authQop, nonceCountString)); request.addOutboundDecorator(clientAuthDecorator); } diff --git a/src/libs/resiprocate/resip/dum/ClientInviteSession.cxx b/src/libs/resiprocate/resip/dum/ClientInviteSession.cxx index 7c5e3764..05a06b3e 100644 --- a/src/libs/resiprocate/resip/dum/ClientInviteSession.cxx +++ b/src/libs/resiprocate/resip/dum/ClientInviteSession.cxx @@ -36,7 +36,7 @@ ClientInviteSession::ClientInviteSession(DialogUsageManager& dum, assert(request->isRequest()); if(initialOffer) { - mProposedLocalOfferAnswer = auto_ptr(initialOffer->clone()); + mProposedLocalOfferAnswer = unique_ptr(initialOffer->clone()); mProposedEncryptionLevel = level; } *mLastLocalSessionModification = *request; // Copy message, so that modifications to mLastLocalSessionModification don't effect creator->getLastRequest @@ -663,7 +663,7 @@ ClientInviteSession::dispatchStart (const SipMessage& msg) assert(msg.header(h_CSeq).method() == INVITE); InviteSessionHandler* handler = mDum.mInviteSessionHandler; - std::auto_ptr offerAnswer = InviteSession::getOfferAnswer(msg); + std::unique_ptr offerAnswer = InviteSession::getOfferAnswer(msg); InviteSession::Event event = toEvent(msg, offerAnswer.get()); @@ -793,7 +793,7 @@ void ClientInviteSession::dispatchEarly (const SipMessage& msg) { InviteSessionHandler* handler = mDum.mInviteSessionHandler; - std::auto_ptr offerAnswer = InviteSession::getOfferAnswer(msg); + std::unique_ptr offerAnswer = InviteSession::getOfferAnswer(msg); switch (toEvent(msg, offerAnswer.get())) { @@ -920,7 +920,7 @@ void ClientInviteSession::dispatchAnswered (const SipMessage& msg) { //InviteSessionHandler* handler = mDum.mInviteSessionHandler; - std::auto_ptr offerAnswer = InviteSession::getOfferAnswer(msg); + std::unique_ptr offerAnswer = InviteSession::getOfferAnswer(msg); switch (toEvent(msg, offerAnswer.get())) { @@ -972,7 +972,7 @@ void ClientInviteSession::dispatchEarlyWithOffer (const SipMessage& msg) { InviteSessionHandler* handler = mDum.mInviteSessionHandler; - std::auto_ptr offerAnswer = InviteSession::getOfferAnswer(msg); + std::unique_ptr offerAnswer = InviteSession::getOfferAnswer(msg); switch (toEvent(msg, offerAnswer.get())) { @@ -1040,7 +1040,7 @@ void ClientInviteSession::dispatchSentAnswer (const SipMessage& msg) { InviteSessionHandler* handler = mDum.mInviteSessionHandler; - std::auto_ptr offerAnswer = InviteSession::getOfferAnswer(msg); + std::unique_ptr offerAnswer = InviteSession::getOfferAnswer(msg); switch (toEvent(msg, offerAnswer.get())) { @@ -1101,7 +1101,7 @@ void ClientInviteSession::dispatchQueuedUpdate (const SipMessage& msg) { InviteSessionHandler* handler = mDum.mInviteSessionHandler; - std::auto_ptr offerAnswer = InviteSession::getOfferAnswer(msg); + std::unique_ptr offerAnswer = InviteSession::getOfferAnswer(msg); switch (toEvent(msg, offerAnswer.get())) { @@ -1179,7 +1179,7 @@ void ClientInviteSession::dispatchEarlyWithAnswer (const SipMessage& msg) { InviteSessionHandler* handler = mDum.mInviteSessionHandler; - std::auto_ptr offerAnswer = InviteSession::getOfferAnswer(msg); + std::unique_ptr offerAnswer = InviteSession::getOfferAnswer(msg); switch (toEvent(msg, offerAnswer.get())) { @@ -1258,7 +1258,7 @@ void ClientInviteSession::dispatchSentUpdateEarly (const SipMessage& msg) { InviteSessionHandler* handler = mDum.mInviteSessionHandler; - std::auto_ptr offerAnswer = InviteSession::getOfferAnswer(msg); + std::unique_ptr offerAnswer = InviteSession::getOfferAnswer(msg); switch (toEvent(msg, offerAnswer.get())) { @@ -1322,7 +1322,7 @@ void ClientInviteSession::dispatchSentUpdateEarlyGlare (const SipMessage& msg) { InviteSessionHandler* handler = mDum.mInviteSessionHandler; - std::auto_ptr offerAnswer = InviteSession::getOfferAnswer(msg); + std::unique_ptr offerAnswer = InviteSession::getOfferAnswer(msg); switch (toEvent(msg, offerAnswer.get())) { @@ -1364,7 +1364,7 @@ ClientInviteSession::dispatchReceivedUpdateEarly (const SipMessage& msg) { /* InviteSessionHandler* handler = mDum.mInviteSessionHandler; - std::auto_ptr offerAnswer = InviteSession::getOfferAnswer(msg); + std::unique_ptr offerAnswer = InviteSession::getOfferAnswer(msg); switch (toEvent(msg, offerAnswer.get())) { @@ -1382,7 +1382,7 @@ void ClientInviteSession::dispatchCancelled (const SipMessage& msg) { InviteSessionHandler* handler = mDum.mInviteSessionHandler; - std::auto_ptr offerAnswer = InviteSession::getOfferAnswer(msg); + std::unique_ptr offerAnswer = InviteSession::getOfferAnswer(msg); switch (toEvent(msg, offerAnswer.get())) { diff --git a/src/libs/resiprocate/resip/dum/ClientPagerMessage.cxx b/src/libs/resiprocate/resip/dum/ClientPagerMessage.cxx index 06672341..5064556b 100644 --- a/src/libs/resiprocate/resip/dum/ClientPagerMessage.cxx +++ b/src/libs/resiprocate/resip/dum/ClientPagerMessage.cxx @@ -113,7 +113,7 @@ ClientPagerMessage::getMessageRequest() } void -ClientPagerMessage::page(std::auto_ptr contents, +ClientPagerMessage::page(std::unique_ptr contents, DialogUsageManager::EncryptionLevel level) { assert(contents.get() != 0); @@ -132,7 +132,7 @@ class ClientPagerMessagePageCommand : public DumCommandAdapter { public: ClientPagerMessagePageCommand(ClientPagerMessage& clientPagerMessage, - std::auto_ptr contents, + std::unique_ptr contents, DialogUsageManager::EncryptionLevel level) : mClientPagerMessage(clientPagerMessage), mContents(contents), @@ -152,12 +152,12 @@ public: } private: ClientPagerMessage& mClientPagerMessage; - std::auto_ptr mContents; + std::unique_ptr mContents; DialogUsageManager::EncryptionLevel mLevel; }; void -ClientPagerMessage::pageCommand(std::auto_ptr contents, +ClientPagerMessage::pageCommand(std::unique_ptr contents, DialogUsageManager::EncryptionLevel level) { mDum.post(new ClientPagerMessagePageCommand(*this, contents, level)); @@ -203,7 +203,7 @@ ClientPagerMessage::dispatch(const SipMessage& msg) Contents* p = contents->contents; WarningLog ( << "Paging failed " << *p ); Helper::makeResponse(errResponse, *mRequest, code); - handler->onFailure(getHandle(), errResponse, std::auto_ptr(p)); + handler->onFailure(getHandle(), errResponse, std::unique_ptr(p)); contents->contents = 0; } mMsgQueue.clear(); diff --git a/src/libs/resiprocate/resip/dum/ClientPublication.cxx b/src/libs/resiprocate/resip/dum/ClientPublication.cxx index 5348b112..42f9aaad 100644 --- a/src/libs/resiprocate/resip/dum/ClientPublication.cxx +++ b/src/libs/resiprocate/resip/dum/ClientPublication.cxx @@ -322,7 +322,7 @@ public: private: ClientPublication& mClientPublication; - std::auto_ptr mBody; + std::unique_ptr mBody; }; void diff --git a/src/libs/resiprocate/resip/dum/DialogEventInfo.cxx b/src/libs/resiprocate/resip/dum/DialogEventInfo.cxx index 9e6186ba..ce834cc4 100644 --- a/src/libs/resiprocate/resip/dum/DialogEventInfo.cxx +++ b/src/libs/resiprocate/resip/dum/DialogEventInfo.cxx @@ -31,17 +31,17 @@ DialogEventInfo::DialogEventInfo(const DialogEventInfo& rhs) { if (rhs.mReplacesId.get()) { - mReplacesId = std::auto_ptr(new DialogId(rhs.mReplacesId->getCallId(), + mReplacesId = std::unique_ptr(new DialogId(rhs.mReplacesId->getCallId(), rhs.mReplacesId->getLocalTag(), rhs.mReplacesId->getRemoteTag())); } if (rhs.mLocalOfferAnswer.get()) { - mLocalOfferAnswer = std::auto_ptr(rhs.mLocalOfferAnswer->clone()); + mLocalOfferAnswer = std::unique_ptr(rhs.mLocalOfferAnswer->clone()); } if (rhs.mRemoteOfferAnswer.get()) { - mRemoteOfferAnswer = std::auto_ptr(rhs.mRemoteOfferAnswer->clone()); + mRemoteOfferAnswer = std::unique_ptr(rhs.mRemoteOfferAnswer->clone()); } } diff --git a/src/libs/resiprocate/resip/dum/DialogEventStateManager.cxx b/src/libs/resiprocate/resip/dum/DialogEventStateManager.cxx index dcac20cd..add0a1cd 100644 --- a/src/libs/resiprocate/resip/dum/DialogEventStateManager.cxx +++ b/src/libs/resiprocate/resip/dum/DialogEventStateManager.cxx @@ -26,11 +26,11 @@ DialogEventStateManager::onTryingUas(Dialog& dialog, const SipMessage& invite) eventInfo->mDirection = DialogEventInfo::Recipient; eventInfo->mCreationTimeSeconds = Timer::getTimeSecs(); eventInfo->mInviteSession = InviteSessionHandle::NotValid(); - eventInfo->mRemoteOfferAnswer = (invite.getContents() != NULL ? std::auto_ptr(invite.getContents()->clone()) : std::auto_ptr()); + eventInfo->mRemoteOfferAnswer = (invite.getContents() != NULL ? std::unique_ptr(invite.getContents()->clone()) : std::unique_ptr()); eventInfo->mLocalIdentity = dialog.getLocalNameAddr(); eventInfo->mLocalTarget = dialog.getLocalContact().uri(); // !slg! TODO - fix me - the Dialog stored local contact has an empty hostname so that the stack will fill it in eventInfo->mRemoteIdentity = dialog.getRemoteNameAddr(); - eventInfo->mRemoteTarget = std::auto_ptr(new Uri(dialog.getRemoteTarget().uri())); + eventInfo->mRemoteTarget = std::unique_ptr(new Uri(dialog.getRemoteTarget().uri())); eventInfo->mRouteSet = dialog.getRouteSet(); eventInfo->mState = DialogEventInfo::Trying; @@ -40,7 +40,7 @@ DialogEventStateManager::onTryingUas(Dialog& dialog, const SipMessage& invite) Data replacesToTag = invite.header(h_Replaces).exists(p_toTag) ? invite.header(h_Replaces).param(p_toTag) : Data::Empty; Data replacesFromTag = invite.header(h_Replaces).exists(p_fromTag) ? invite.header(h_Replaces).param(p_fromTag) : Data::Empty; - eventInfo->mReplacesId = std::auto_ptr(new DialogId(invite.header(h_Replaces).value(), + eventInfo->mReplacesId = std::unique_ptr(new DialogId(invite.header(h_Replaces).value(), replacesToTag, replacesFromTag)); @@ -53,7 +53,7 @@ DialogEventStateManager::onTryingUas(Dialog& dialog, const SipMessage& invite) if (invite.exists(h_ReferredBy) && invite.header(h_ReferredBy).isWellFormed()) { - eventInfo->mReferredBy = std::auto_ptr(new NameAddr(invite.header(h_ReferredBy))); + eventInfo->mReferredBy = std::unique_ptr(new NameAddr(invite.header(h_ReferredBy))); } mDialogIdToEventInfo[dialog.getId()] = eventInfo; @@ -98,13 +98,13 @@ DialogEventStateManager::onTryingUac(DialogSet& dialogSet, const SipMessage& inv assert(invite.header(h_Contacts).front().isWellFormed()); eventInfo->mLocalTarget = invite.header(h_Contacts).front().uri(); eventInfo->mRemoteIdentity = invite.header(h_To); - eventInfo->mLocalOfferAnswer = (invite.getContents() != NULL ? std::auto_ptr(invite.getContents()->clone()) : std::auto_ptr()); + eventInfo->mLocalOfferAnswer = (invite.getContents() != NULL ? std::unique_ptr(invite.getContents()->clone()) : std::unique_ptr()); eventInfo->mState = DialogEventInfo::Trying; if (invite.exists(h_ReferredBy) && invite.header(h_ReferredBy).isWellFormed()) { - eventInfo->mReferredBy = std::auto_ptr(new NameAddr(invite.header(h_ReferredBy))); + eventInfo->mReferredBy = std::unique_ptr(new NameAddr(invite.header(h_ReferredBy))); } mDialogIdToEventInfo[eventInfo->mDialogId] = eventInfo; @@ -132,7 +132,7 @@ DialogEventStateManager::onProceedingUac(const DialogSet& dialogSet, const SipMe // ?bwc? Has something already checked for well-formedness here? // Maybe DialogSet? Assert for now. assert(response.header(h_Contacts).front().isWellFormed()); - eventInfo->mRemoteTarget = std::auto_ptr(new Uri(response.header(h_Contacts).front().uri())); + eventInfo->mRemoteTarget = std::unique_ptr(new Uri(response.header(h_Contacts).front().uri())); } ProceedingDialogEvent evt(*eventInfo); mDialogEventHandler->onProceeding(evt); @@ -162,7 +162,7 @@ DialogEventStateManager::onEarly(const Dialog& dialog, InviteSessionHandle is) // local or remote target might change due to an UPDATE or re-INVITE eventInfo->mLocalTarget = dialog.getLocalContact().uri(); // !slg! TODO - fix me - the Dialog stored local contact has an empty hostname so that the stack will fill it in - eventInfo->mRemoteTarget = std::auto_ptr(new Uri(dialog.getRemoteTarget().uri())); + eventInfo->mRemoteTarget = std::unique_ptr(new Uri(dialog.getRemoteTarget().uri())); EarlyDialogEvent evt(*eventInfo); mDialogEventHandler->onEarly(evt); @@ -183,7 +183,7 @@ DialogEventStateManager::onConfirmed(const Dialog& dialog, InviteSessionHandle i // local or remote target might change due to an UPDATE or re-INVITE eventInfo->mLocalTarget = dialog.getLocalContact().uri(); // !slg! TODO - fix me - the Dialog stored local contact has an empty hostname so that the stack will fill it in - eventInfo->mRemoteTarget = std::auto_ptr(new Uri(dialog.getRemoteTarget().uri())); + eventInfo->mRemoteTarget = std::unique_ptr(new Uri(dialog.getRemoteTarget().uri())); // for the dialog that got the 200 OK SharedPtr confirmedEvt(new ConfirmedDialogEvent(*eventInfo)); @@ -239,7 +239,7 @@ DialogEventStateManager::onTerminated(const Dialog& dialog, const SipMessage& ms { // .jjg. we're killing a *specific* dialog *after* the successful completion of the initial INVITE transaction; // so just elminate this dialog, not the entire dialogset - std::auto_ptr evt(onDialogTerminatedImpl(it->second, reason, getResponseCode(msg), getFrontContact(msg))); + std::unique_ptr evt(onDialogTerminatedImpl(it->second, reason, getResponseCode(msg), getFrontContact(msg))); mDialogEventHandler->onTerminated(*evt); delete it->second; mDialogIdToEventInfo.erase(it++); @@ -283,7 +283,7 @@ DialogEventStateManager::onDialogSetTerminatedImpl(const DialogSetId& dialogSetI it->first.getDialogSetId() == dialogSetId) { eventInfo = it->second; - std::auto_ptr evt(onDialogTerminatedImpl(eventInfo, reason, getResponseCode(msg), getFrontContact(msg))); + std::unique_ptr evt(onDialogTerminatedImpl(eventInfo, reason, getResponseCode(msg), getFrontContact(msg))); mDialogEventHandler->onTerminated(*evt); delete it->second; mDialogIdToEventInfo.erase(it++); @@ -311,7 +311,7 @@ DialogEventStateManager::onDialogTerminatedImpl(DialogEventInfo* eventInfo, if (remoteTarget) { - eventInfo->mRemoteTarget = std::auto_ptr(remoteTarget); + eventInfo->mRemoteTarget = std::unique_ptr(remoteTarget); } TerminatedDialogEvent* evt = new TerminatedDialogEvent(*eventInfo, actualReason, responseCode); @@ -403,7 +403,7 @@ DialogEventStateManager::findOrCreateDialogInfo(const Dialog& dialog) newForkInfo->mCreationTimeSeconds = Timer::getTimeSecs(); newForkInfo->mDialogId = dialog.getId(); newForkInfo->mRemoteIdentity = dialog.getRemoteNameAddr(); - newForkInfo->mRemoteTarget = std::auto_ptr(new Uri(dialog.getRemoteTarget().uri())); + newForkInfo->mRemoteTarget = std::unique_ptr(new Uri(dialog.getRemoteTarget().uri())); newForkInfo->mRouteSet = dialog.getRouteSet(); eventInfo = newForkInfo; } diff --git a/src/libs/resiprocate/resip/dum/DialogUsageManager.cxx b/src/libs/resiprocate/resip/dum/DialogUsageManager.cxx index 6207133b..7d4daf19 100644 --- a/src/libs/resiprocate/resip/dum/DialogUsageManager.cxx +++ b/src/libs/resiprocate/resip/dum/DialogUsageManager.cxx @@ -292,7 +292,7 @@ DialogUsageManager::forceShutdown(DumShutdownHandler* h) DialogUsageManager::onAllHandlesDestroyed(); } -void DialogUsageManager::setAppDialogSetFactory(std::auto_ptr factory) +void DialogUsageManager::setAppDialogSetFactory(std::unique_ptr factory) { mAppDialogSetFactory = factory; } @@ -318,13 +318,13 @@ void DialogUsageManager::setMasterProfile(const SharedPtr& master mMasterUserProfile = masterProfile; // required so that we can return a reference to SharedPtr in getMasterUserProfile } -void DialogUsageManager::setKeepAliveManager(std::auto_ptr manager) +void DialogUsageManager::setKeepAliveManager(std::unique_ptr manager) { mKeepAliveManager = manager; mKeepAliveManager->setDialogUsageManager(this); } -void DialogUsageManager::setRedirectManager(std::auto_ptr manager) +void DialogUsageManager::setRedirectManager(std::unique_ptr manager) { mRedirectManager = manager; } @@ -340,7 +340,7 @@ RedirectHandler* DialogUsageManager::getRedirectHandler() } void -DialogUsageManager::setClientAuthManager(std::auto_ptr manager) +DialogUsageManager::setClientAuthManager(std::unique_ptr manager) { mClientAuthManager = manager; } @@ -393,7 +393,7 @@ DialogUsageManager::setRegistrationPersistenceManager(RegistrationPersistenceMan } void -DialogUsageManager::setRemoteCertStore(auto_ptr store) +DialogUsageManager::setRemoteCertStore(unique_ptr store) { } @@ -924,7 +924,7 @@ DialogUsageManager::send(SharedPtr msg) SharedPtr outboundDecorator = userProfile->getOutboundDecorator(); if (outboundDecorator.get()) { - msg->addOutboundDecorator(std::auto_ptr(outboundDecorator->clone())); + msg->addOutboundDecorator(std::unique_ptr(outboundDecorator->clone())); } else { @@ -987,7 +987,7 @@ DialogUsageManager::send(SharedPtr msg) DebugLog (<< "SEND: " << std::endl << std::endl << *msg); OutgoingEvent* event = new OutgoingEvent(msg); - outgoingProcess(auto_ptr(event)); + outgoingProcess(unique_ptr(event)); } void @@ -998,7 +998,7 @@ DialogUsageManager::sendCommand(SharedPtr request) } -void DialogUsageManager::outgoingProcess(auto_ptr message) +void DialogUsageManager::outgoingProcess(unique_ptr message) { Data tid = Data::Empty; { @@ -1073,10 +1073,10 @@ void DialogUsageManager::outgoingProcess(auto_ptr message) assert(userProfile); - //!dcm! -- unique SharedPtr to auto_ptr conversion prob. a worthwhile + //!dcm! -- unique SharedPtr to unique_ptr conversion prob. a worthwhile //optimzation here. SharedPtr would have to be changed; would //throw/assert if not unique. - std::auto_ptr toSend(static_cast(event->message()->clone())); + std::unique_ptr toSend(static_cast(event->message()->clone())); // .bwc. Protect ourselves from garbage with an isWellFormed() check. // (Code in Dialog doesn't check for well-formedness in the @@ -1102,7 +1102,7 @@ void DialogUsageManager::outgoingProcess(auto_ptr message) } void -DialogUsageManager::sendUsingOutboundIfAppropriate(UserProfile& userProfile, auto_ptr msg) +DialogUsageManager::sendUsingOutboundIfAppropriate(UserProfile& userProfile, unique_ptr msg) { //a little inefficient, branch parameter might be better DialogId id(*msg); @@ -1308,7 +1308,7 @@ AppDialogSetHandle DialogUsageManager::findAppDialogSet(const DialogSetId& id) } void -DialogUsageManager::internalProcess(std::auto_ptr msg) +DialogUsageManager::internalProcess(std::unique_ptr msg) { #ifdef RESIP_DUM_THREAD_DEBUG if(!mThreadDebugKey) @@ -1499,7 +1499,7 @@ DialogUsageManager::processExternalMessage(ExternalMessageBase* externalMessage) } void -DialogUsageManager::incomingProcess(std::auto_ptr msg) +DialogUsageManager::incomingProcess(std::unique_ptr msg) { //call or create feature chain if appropriate Data tid = Data::Empty; @@ -1680,7 +1680,7 @@ DialogUsageManager::process(resip::Lockable* mutex) #ifdef RESIP_DUM_THREAD_DEBUG mThreadDebugKey=mHiddenThreadDebugKey; #endif - internalProcess(std::auto_ptr(mFifo.getNext())); + internalProcess(std::unique_ptr(mFifo.getNext())); #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- @@ -1698,7 +1698,7 @@ DialogUsageManager::process(resip::Lockable* mutex) bool DialogUsageManager::process(int timeoutMs, resip::Lockable* mutex) { - std::auto_ptr message; + std::unique_ptr message; if(timeoutMs == -1) { diff --git a/src/libs/resiprocate/resip/dum/DumFeature.cxx b/src/libs/resiprocate/resip/dum/DumFeature.cxx index 162be72a..de451888 100644 --- a/src/libs/resiprocate/resip/dum/DumFeature.cxx +++ b/src/libs/resiprocate/resip/dum/DumFeature.cxx @@ -16,7 +16,7 @@ DumFeature::~DumFeature() { } -void DumFeature::postCommand(std::auto_ptr message) +void DumFeature::postCommand(std::unique_ptr message) { mDum.post(new TargetCommand(mTarget, message)); } diff --git a/src/libs/resiprocate/resip/dum/DumHelper.cxx b/src/libs/resiprocate/resip/dum/DumHelper.cxx index 1926abdc..e5dee2b3 100644 --- a/src/libs/resiprocate/resip/dum/DumHelper.cxx +++ b/src/libs/resiprocate/resip/dum/DumHelper.cxx @@ -12,7 +12,7 @@ void DumHelper::setOutgoingEncryptionLevel(SipMessage& message, { SecurityAttributes* attr = new SecurityAttributes(); attr->setOutgoingEncryptionLevel(convert(level)); - message.setSecurityAttributes(auto_ptr(attr)); + message.setSecurityAttributes(unique_ptr(attr)); } void DumHelper::setEncryptionPerformed(SipMessage& message) @@ -20,7 +20,7 @@ void DumHelper::setEncryptionPerformed(SipMessage& message) SecurityAttributes* attr = new SecurityAttributes(); attr->setOutgoingEncryptionLevel(message.getSecurityAttributes()->getOutgoingEncryptionLevel()); attr->setEncryptionPerformed(true); - message.setSecurityAttributes(auto_ptr(attr)); + message.setSecurityAttributes(unique_ptr(attr)); } SecurityAttributes::OutgoingEncryptionLevel DumHelper::convert(DialogUsageManager::EncryptionLevel level) diff --git a/src/libs/resiprocate/resip/dum/DumThread.cxx b/src/libs/resiprocate/resip/dum/DumThread.cxx index 343202db..5403b880 100644 --- a/src/libs/resiprocate/resip/dum/DumThread.cxx +++ b/src/libs/resiprocate/resip/dum/DumThread.cxx @@ -18,7 +18,7 @@ DumThread::thread() { try { - std::auto_ptr msg(mDum.mFifo.getNext(1000)); // Only need to wake up to see if we are shutdown + 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); diff --git a/src/libs/resiprocate/resip/dum/HttpProvider.cxx b/src/libs/resiprocate/resip/dum/HttpProvider.cxx index 7b7aa751..91e0f72d 100644 --- a/src/libs/resiprocate/resip/dum/HttpProvider.cxx +++ b/src/libs/resiprocate/resip/dum/HttpProvider.cxx @@ -4,11 +4,11 @@ using namespace resip; HttpProvider* HttpProvider::mInstance = 0; -std::auto_ptr HttpProvider::mFactory; +std::unique_ptr HttpProvider::mFactory; Mutex HttpProvider::mMutex; void -HttpProvider::setFactory(std::auto_ptr fact) +HttpProvider::setFactory(std::unique_ptr fact) { mFactory = fact; } diff --git a/src/libs/resiprocate/resip/dum/IdentityHandler.cxx b/src/libs/resiprocate/resip/dum/IdentityHandler.cxx index 19d06b17..524f4956 100644 --- a/src/libs/resiprocate/resip/dum/IdentityHandler.cxx +++ b/src/libs/resiprocate/resip/dum/IdentityHandler.cxx @@ -98,7 +98,7 @@ IdentityHandler::queueForIdentityCheck(SipMessage* sipMsg) } #endif - std::auto_ptr sec(new SecurityAttributes); + std::unique_ptr sec(new SecurityAttributes); sec->setIdentity(sipMsg->header(h_From).uri().getAor()); sec->setIdentityStrength(SecurityAttributes::From); sipMsg->setSecurityAttributes(sec); @@ -114,7 +114,7 @@ IdentityHandler::processIdentityCheckResponse(const HttpGetMessage& msg) if (it != mRequiresCerts.end()) { mDum.getSecurity()->checkAndSetIdentity( *it->second, msg.getBodyData() ); - postCommand(auto_ptr(it->second)); + postCommand(unique_ptr(it->second)); mRequiresCerts.erase(it); } #endif diff --git a/src/libs/resiprocate/resip/dum/InviteSession.cxx b/src/libs/resiprocate/resip/dum/InviteSession.cxx index 9a2dfa48..31d85c5b 100644 --- a/src/libs/resiprocate/resip/dum/InviteSession.cxx +++ b/src/libs/resiprocate/resip/dum/InviteSession.cxx @@ -507,9 +507,9 @@ public: } private: InviteSession& mInviteSession; - std::auto_ptr mOffer; + std::unique_ptr mOffer; DialogUsageManager::EncryptionLevel mLevel; - std::auto_ptr mAlternative; + std::unique_ptr mAlternative; }; void @@ -544,7 +544,7 @@ public: } private: InviteSession& mInviteSession; - std::auto_ptr mOffer; + std::unique_ptr mOffer; }; void @@ -621,7 +621,7 @@ public: } private: InviteSession& mInviteSession; - std::auto_ptr mAnswer; + std::unique_ptr mAnswer; }; void @@ -813,7 +813,7 @@ public: private: InviteSession& mInviteSession; int mCode; - std::auto_ptr mWarning; + std::unique_ptr mWarning; }; void @@ -840,10 +840,10 @@ InviteSession::targetRefresh(const NameAddr& localUri) void InviteSession::refer(const NameAddr& referTo, bool referSub) { - refer(referTo,std::auto_ptr(0),referSub); + refer(referTo,std::unique_ptr(0),referSub); } void -InviteSession::refer(const NameAddr& referTo, std::auto_ptr contents,bool referSub) +InviteSession::refer(const NameAddr& referTo, std::unique_ptr contents,bool referSub) { if (isConnected()) // ?slg? likely not safe in any state except Connected - what should behaviour be if state is ReceivedReinvite? { @@ -938,11 +938,11 @@ InviteSession::referCommand(const NameAddr& referTo, bool referSub) void InviteSession::refer(const NameAddr& referTo, InviteSessionHandle sessionToReplace, bool referSub) { - refer(referTo,sessionToReplace,std::auto_ptr(0),referSub); + refer(referTo,sessionToReplace,std::unique_ptr(0),referSub); } void -InviteSession::refer(const NameAddr& referTo, InviteSessionHandle sessionToReplace, std::auto_ptr contents, bool referSub) +InviteSession::refer(const NameAddr& referTo, InviteSessionHandle sessionToReplace, std::unique_ptr contents, bool referSub) { if (!sessionToReplace.isValid()) { @@ -961,11 +961,11 @@ InviteSession::refer(const NameAddr& referTo, InviteSessionHandle sessionToRepla void InviteSession::refer(const NameAddr& referTo, const CallId& replaces, bool referSub) { - refer(referTo,replaces,std::auto_ptr(0),referSub); + refer(referTo,replaces,std::unique_ptr(0),referSub); } void -InviteSession::refer(const NameAddr& referTo, const CallId& replaces, std::auto_ptr contents, bool referSub) +InviteSession::refer(const NameAddr& referTo, const CallId& replaces, std::unique_ptr contents, bool referSub) { if (isConnected()) // ?slg? likely not safe in any state except Connected - what should behaviour be if state is ReceivedReinvite? { @@ -1078,7 +1078,7 @@ public: } private: InviteSession& mInviteSession; - std::auto_ptr mContents; + std::unique_ptr mContents; }; void @@ -1128,7 +1128,7 @@ public: } private: InviteSession& mInviteSession; - std::auto_ptr mContents; + std::unique_ptr mContents; }; @@ -1365,7 +1365,7 @@ void InviteSession::dispatchConnected(const SipMessage& msg) { InviteSessionHandler* handler = mDum.mInviteSessionHandler; - std::auto_ptr offerAnswer = InviteSession::getOfferAnswer(msg); + std::unique_ptr offerAnswer = InviteSession::getOfferAnswer(msg); switch (toEvent(msg, offerAnswer.get())) { @@ -1440,7 +1440,7 @@ void InviteSession::dispatchSentUpdate(const SipMessage& msg) { InviteSessionHandler* handler = mDum.mInviteSessionHandler; - std::auto_ptr offerAnswer = InviteSession::getOfferAnswer(msg); + std::unique_ptr offerAnswer = InviteSession::getOfferAnswer(msg); switch (toEvent(msg, offerAnswer.get())) { @@ -1523,7 +1523,7 @@ void InviteSession::dispatchSentReinvite(const SipMessage& msg) { InviteSessionHandler* handler = mDum.mInviteSessionHandler; - std::auto_ptr offerAnswer = InviteSession::getOfferAnswer(msg); + std::unique_ptr offerAnswer = InviteSession::getOfferAnswer(msg); switch (toEvent(msg, offerAnswer.get())) { @@ -1644,7 +1644,7 @@ void InviteSession::dispatchSentReinviteNoOffer(const SipMessage& msg) { InviteSessionHandler* handler = mDum.mInviteSessionHandler; - std::auto_ptr offerAnswer = InviteSession::getOfferAnswer(msg); + std::unique_ptr offerAnswer = InviteSession::getOfferAnswer(msg); switch (toEvent(msg, offerAnswer.get())) { @@ -1739,7 +1739,7 @@ void InviteSession::dispatchReceivedReinviteSentOffer(const SipMessage& msg) { InviteSessionHandler* handler = mDum.mInviteSessionHandler; - std::auto_ptr offerAnswer = InviteSession::getOfferAnswer(msg); + std::unique_ptr offerAnswer = InviteSession::getOfferAnswer(msg); switch (toEvent(msg, offerAnswer.get())) { @@ -1839,7 +1839,7 @@ void InviteSession::dispatchReceivedUpdateOrReinvite(const SipMessage& msg) { // InviteSessionHandler* handler = mDum.mInviteSessionHandler; // unused - std::auto_ptr offerAnswer = InviteSession::getOfferAnswer(msg); + std::unique_ptr offerAnswer = InviteSession::getOfferAnswer(msg); switch (toEvent(msg, offerAnswer.get())) { @@ -1966,7 +1966,7 @@ InviteSession::dispatchWaitingToTerminate(const SipMessage& msg) void InviteSession::dispatchWaitingToHangup(const SipMessage& msg) { - std::auto_ptr offerAnswer = InviteSession::getOfferAnswer(msg); + std::unique_ptr offerAnswer = InviteSession::getOfferAnswer(msg); switch (toEvent(msg, offerAnswer.get())) { @@ -2239,7 +2239,7 @@ public: private: InviteSession& mInviteSession; int mStatusCode; - std::auto_ptr mContents; + std::unique_ptr mContents; }; void @@ -2744,34 +2744,34 @@ InviteSession::isReliable(const SipMessage& msg) } } -//static std::auto_ptr emptySdp; -std::auto_ptr +//static std::unique_ptr emptySdp; +std::unique_ptr InviteSession::getOfferAnswer(const SipMessage& msg) { if(mDum.mInviteSessionHandler->isGenericOfferAnswer()) { if(msg.getContents()) { - return std::auto_ptr(msg.getContents()->clone()); + return std::unique_ptr(msg.getContents()->clone()); } else { - return std::auto_ptr(); + return std::unique_ptr(); } } else { - return std::auto_ptr(Helper::getSdp(msg.getContents())); + return std::unique_ptr(Helper::getSdp(msg.getContents())); } } -std::auto_ptr +std::unique_ptr InviteSession::makeOfferAnswer(const Contents& offerAnswer) { - return std::auto_ptr(static_cast(offerAnswer.clone())); + return std::unique_ptr(static_cast(offerAnswer.clone())); } -auto_ptr +unique_ptr InviteSession::makeOfferAnswer(const Contents& offerAnswer, const Contents* alternative) { @@ -2780,11 +2780,11 @@ InviteSession::makeOfferAnswer(const Contents& offerAnswer, MultipartAlternativeContents* mac = new MultipartAlternativeContents; mac->parts().push_back(alternative->clone()); mac->parts().push_back(offerAnswer.clone()); - return auto_ptr(mac); + return unique_ptr(mac); } else { - return auto_ptr(offerAnswer.clone()); + return unique_ptr(offerAnswer.clone()); } } @@ -2800,7 +2800,7 @@ InviteSession::setOfferAnswer(SipMessage& msg, const Contents& offerAnswer, cons MultipartAlternativeContents* mac = new MultipartAlternativeContents; mac->parts().push_back(alternative->clone()); mac->parts().push_back(offerAnswer.clone()); - msg.setContents(auto_ptr(mac)); + msg.setContents(unique_ptr(mac)); } else { @@ -3115,16 +3115,16 @@ InviteSession::setCurrentLocalOfferAnswer(const SipMessage& msg) { if (DialogUsageManager::Encrypt == getEncryptionLevel(msg) || DialogUsageManager::SignAndEncrypt == getEncryptionLevel(msg)) { - mCurrentLocalOfferAnswer = auto_ptr(static_cast((dynamic_cast(mProposedLocalOfferAnswer.get()))->parts().back()->clone())); + mCurrentLocalOfferAnswer = unique_ptr(static_cast((dynamic_cast(mProposedLocalOfferAnswer.get()))->parts().back()->clone())); } else { - mCurrentLocalOfferAnswer = auto_ptr(static_cast((dynamic_cast(mProposedLocalOfferAnswer.get()))->parts().front()->clone())); + mCurrentLocalOfferAnswer = unique_ptr(static_cast((dynamic_cast(mProposedLocalOfferAnswer.get()))->parts().front()->clone())); } } else { - mCurrentLocalOfferAnswer = auto_ptr(static_cast(mProposedLocalOfferAnswer.get()->clone())); + mCurrentLocalOfferAnswer = unique_ptr(static_cast(mProposedLocalOfferAnswer.get()->clone())); } mProposedLocalOfferAnswer.reset(); } diff --git a/src/libs/resiprocate/resip/dum/InviteSessionCreator.cxx b/src/libs/resiprocate/resip/dum/InviteSessionCreator.cxx index 54b8c9a8..3dfb551d 100644 --- a/src/libs/resiprocate/resip/dum/InviteSessionCreator.cxx +++ b/src/libs/resiprocate/resip/dum/InviteSessionCreator.cxx @@ -37,7 +37,7 @@ InviteSessionCreator::InviteSessionCreator(DialogUsageManager& dum, } } - std::auto_ptr initialOffer; + std::unique_ptr initialOffer; if (initial) { if (alternative) diff --git a/src/libs/resiprocate/resip/dum/ServerAuthManager.cxx b/src/libs/resiprocate/resip/dum/ServerAuthManager.cxx index 9fe4f4a3..c056f5bf 100644 --- a/src/libs/resiprocate/resip/dum/ServerAuthManager.cxx +++ b/src/libs/resiprocate/resip/dum/ServerAuthManager.cxx @@ -65,7 +65,7 @@ ServerAuthManager::process(Message* msg) InfoLog(<< "ServerAuth got ChallengeInfo " << challengeInfo->brief()); MessageMap::iterator it = mMessages.find(challengeInfo->getTransactionId()); assert(it != mMessages.end()); - std::auto_ptr sipMsg(it->second); + std::unique_ptr sipMsg(it->second); mMessages.erase(it); if(challengeInfo->isFailed()) @@ -88,7 +88,7 @@ ServerAuthManager::process(Message* msg) else { // challenge is not required, re-instate original message - postCommand(auto_ptr(sipMsg)); + postCommand(unique_ptr(sipMsg)); return FeatureDoneAndEventDone; } } @@ -103,7 +103,7 @@ ServerAuthManager::process(Message* msg) Message* result = handleUserAuthInfo(userAuth); if (result) { - postCommand(auto_ptr(result)); + postCommand(unique_ptr(result)); return FeatureDoneAndEventDone; } else diff --git a/src/libs/resiprocate/resip/dum/ServerInviteSession.cxx b/src/libs/resiprocate/resip/dum/ServerInviteSession.cxx index 6c784d79..2c2d982b 100644 --- a/src/libs/resiprocate/resip/dum/ServerInviteSession.cxx +++ b/src/libs/resiprocate/resip/dum/ServerInviteSession.cxx @@ -726,7 +726,7 @@ ServerInviteSession::dispatchStart(const SipMessage& msg) assert(msg.header(h_CSeq).method() == INVITE); InviteSessionHandler* handler = mDum.mInviteSessionHandler; - std::auto_ptr offerAnswer = InviteSession::getOfferAnswer(msg); + std::unique_ptr offerAnswer = InviteSession::getOfferAnswer(msg); storePeerCapabilities(msg); if (mDum.mDialogEventStateManager) @@ -786,7 +786,7 @@ ServerInviteSession::dispatchStart(const SipMessage& msg) void ServerInviteSession::dispatchOfferOrEarly(const SipMessage& msg) { - std::auto_ptr offerAnswer = InviteSession::getOfferAnswer(msg); + std::unique_ptr offerAnswer = InviteSession::getOfferAnswer(msg); switch (toEvent(msg, offerAnswer.get())) { case OnCancel: @@ -806,7 +806,7 @@ void ServerInviteSession::dispatchAccepted(const SipMessage& msg) { InviteSessionHandler* handler = mDum.mInviteSessionHandler; - std::auto_ptr offerAnswer = InviteSession::getOfferAnswer(msg); + std::unique_ptr offerAnswer = InviteSession::getOfferAnswer(msg); InfoLog (<< "dispatchAccepted: " << msg.brief()); switch (toEvent(msg, offerAnswer.get())) @@ -868,7 +868,7 @@ void ServerInviteSession::dispatchWaitingToOffer(const SipMessage& msg) { InviteSessionHandler* handler = mDum.mInviteSessionHandler; - std::auto_ptr offerAnswer = InviteSession::getOfferAnswer(msg); + std::unique_ptr offerAnswer = InviteSession::getOfferAnswer(msg); InfoLog (<< "dispatchWaitingToOffer: " << msg.brief()); switch (toEvent(msg, offerAnswer.get())) @@ -937,7 +937,7 @@ void ServerInviteSession::dispatchWaitingToRequestOffer(const SipMessage& msg) { InviteSessionHandler* handler = mDum.mInviteSessionHandler; - std::auto_ptr offerAnswer = InviteSession::getOfferAnswer(msg); + std::unique_ptr offerAnswer = InviteSession::getOfferAnswer(msg); InfoLog (<< "dispatchWaitingToRequestOffer: " << msg.brief()); switch (toEvent(msg, offerAnswer.get())) @@ -1005,7 +1005,7 @@ void ServerInviteSession::dispatchAcceptedWaitingAnswer(const SipMessage& msg) { InviteSessionHandler* handler = mDum.mInviteSessionHandler; - std::auto_ptr offerAnswer = InviteSession::getOfferAnswer(msg); + std::unique_ptr offerAnswer = InviteSession::getOfferAnswer(msg); switch (toEvent(msg, offerAnswer.get())) { @@ -1131,7 +1131,7 @@ ServerInviteSession::dispatchWaitingToTerminate(const SipMessage& msg) void ServerInviteSession::dispatchWaitingToHangup(const SipMessage& msg) { - std::auto_ptr offerAnswer = InviteSession::getOfferAnswer(msg); + std::unique_ptr offerAnswer = InviteSession::getOfferAnswer(msg); switch (toEvent(msg, offerAnswer.get())) { diff --git a/src/libs/resiprocate/resip/dum/ServerRegistration.cxx b/src/libs/resiprocate/resip/dum/ServerRegistration.cxx index 44fe12a9..febb5276 100644 --- a/src/libs/resiprocate/resip/dum/ServerRegistration.cxx +++ b/src/libs/resiprocate/resip/dum/ServerRegistration.cxx @@ -85,8 +85,8 @@ ServerRegistration::accept(SipMessage& ok) } else { - std::auto_ptr log; - std::auto_ptr contacts; + std::unique_ptr log; + std::unique_ptr contacts; mAsyncLocalStore->releaseLog(log,contacts); @@ -111,8 +111,8 @@ ServerRegistration::accept(SipMessage& ok) //receive a final contact list before sending the 200. mAsyncState = asyncStateAcceptedWaitingForFinalContactList; - std::auto_ptr log; - std::auto_ptr modifiedContacts; + std::unique_ptr log; + std::unique_ptr modifiedContacts; mAsyncLocalStore->releaseLog(log,modifiedContacts); @@ -612,7 +612,7 @@ ServerRegistration::asyncProcessFinalOkMsg(SipMessage &msg, ContactPtrList &cont ContactPtrList::iterator it(contacts.begin()); ContactPtrList::iterator itEnd(contacts.end()); - std::auto_ptr expired; + std::unique_ptr expired; UInt64 now=Timer::getTimeSecs(); @@ -630,7 +630,7 @@ ServerRegistration::asyncProcessFinalOkMsg(SipMessage &msg, ContactPtrList &cont { if (!expired.get()) { - expired = std::auto_ptr(new ContactPtrList()); + expired = std::unique_ptr(new ContactPtrList()); } expired->push_back(rec); continue; @@ -677,7 +677,7 @@ ServerRegistration::processFinalOkMsg(SipMessage &msg, ContactList &contacts) } bool -ServerRegistration::asyncProvideContacts(std::auto_ptr contacts) +ServerRegistration::asyncProvideContacts(std::unique_ptr contacts) { switch (mAsyncState) { @@ -711,7 +711,7 @@ ServerRegistration::asyncProvideContacts(std::auto_ptr co } void -ServerRegistration::asyncProcessFinalContacts(std::auto_ptr contacts) +ServerRegistration::asyncProcessFinalContacts(std::unique_ptr contacts) { if (contacts.get()) { @@ -732,10 +732,10 @@ ServerRegistration::asyncProcessFinalContacts(std::auto_ptr originalContacts) +ServerRegistration::AsyncLocalStore::create(std::unique_ptr originalContacts) { mModifiedContacts = originalContacts; - mLog = std::auto_ptr(new ContactRecordTransactionLog()); + mLog = std::unique_ptr(new ContactRecordTransactionLog()); } void diff --git a/src/libs/resiprocate/resip/dum/TargetCommand.cxx b/src/libs/resiprocate/resip/dum/TargetCommand.cxx index 152286f5..52289020 100644 --- a/src/libs/resiprocate/resip/dum/TargetCommand.cxx +++ b/src/libs/resiprocate/resip/dum/TargetCommand.cxx @@ -7,7 +7,7 @@ using namespace std; TargetCommand::TargetCommand(Target& target, - auto_ptr message) + unique_ptr message) : mTarget(target), mMessage(message) { diff --git a/src/libs/resiprocate/resip/dum/ssl/EncryptionManager.cxx b/src/libs/resiprocate/resip/dum/ssl/EncryptionManager.cxx index 3722c993..a7b11252 100644 --- a/src/libs/resiprocate/resip/dum/ssl/EncryptionManager.cxx +++ b/src/libs/resiprocate/resip/dum/ssl/EncryptionManager.cxx @@ -66,7 +66,7 @@ EncryptionManager::~EncryptionManager() mRequests.clear(); } -void EncryptionManager::setRemoteCertStore(std::auto_ptr store) +void EncryptionManager::setRemoteCertStore(std::unique_ptr store) { ErrLog(<< "Async currently is not supported"); assert(0); @@ -149,7 +149,7 @@ DumFeature::ProcessingResult EncryptionManager::process(Message* msg) { if (setContents) { - event->message()->setContents(auto_ptr(contents)); + event->message()->setContents(unique_ptr(contents)); DumHelper::setEncryptionPerformed(*event->message()); } return DumFeature::FeatureDone; @@ -438,11 +438,11 @@ EncryptionManager::Result EncryptionManager::Sign::received(bool success, { InfoLog(<< "Signing message" << endl); MultipartSignedContents* msc = mDum.getSecurity()->sign(aor, mMsgToEncrypt->getContents()); - mMsgToEncrypt->setContents(auto_ptr(msc)); + mMsgToEncrypt->setContents(unique_ptr(msc)); DumHelper::setEncryptionPerformed(*mMsgToEncrypt); OutgoingEvent* event = new OutgoingEvent(mMsgToEncrypt); //mTaken = false; - mDum.post(new TargetCommand(mDum.dumOutgoingTarget(), auto_ptr(event))); + mDum.post(new TargetCommand(mDum.dumOutgoingTarget(), unique_ptr(event))); result = Complete; } } @@ -533,11 +533,11 @@ EncryptionManager::Result EncryptionManager::Encrypt::received(bool success, --mPendingRequests; InfoLog(<< "Encrypting message" << endl); Pkcs7Contents* encrypted = mDum.getSecurity()->encrypt(mMsgToEncrypt->getContents(), aor); - mMsgToEncrypt->setContents(auto_ptr(encrypted)); + mMsgToEncrypt->setContents(unique_ptr(encrypted)); DumHelper::setEncryptionPerformed(*mMsgToEncrypt); OutgoingEvent* event = new OutgoingEvent(mMsgToEncrypt); //mTaken = false; - mDum.post(new TargetCommand(mDum.dumOutgoingTarget(), auto_ptr(event))); + mDum.post(new TargetCommand(mDum.dumOutgoingTarget(), unique_ptr(event))); } else { @@ -641,11 +641,11 @@ EncryptionManager::Result EncryptionManager::SignAndEncrypt::received(bool succe { InfoLog(<< "Encrypting and signing message" << endl); Contents* contents = doWork(); - mMsgToEncrypt->setContents(auto_ptr(contents)); + mMsgToEncrypt->setContents(unique_ptr(contents)); DumHelper::setEncryptionPerformed(*mMsgToEncrypt); OutgoingEvent* event = new OutgoingEvent(mMsgToEncrypt); //mTaken = false; - mDum.post(new TargetCommand(mDum.dumOutgoingTarget(), auto_ptr(event))); + mDum.post(new TargetCommand(mDum.dumOutgoingTarget(), unique_ptr(event))); result = Complete; } } @@ -925,7 +925,7 @@ bool EncryptionManager::Decrypt::isEncryptedRecurse(Contents** contents) if (*contents == mMsgToDecrypt->getContents()) { - mMsgToDecrypt->setContents(auto_ptr(createInvalidContents(mps))); + mMsgToDecrypt->setContents(unique_ptr(createInvalidContents(mps))); } else { @@ -950,7 +950,7 @@ bool EncryptionManager::Decrypt::isEncryptedRecurse(Contents** contents) ErrLog(<< e.name() << endl << e.getMessage()); if (*contents == mMsgToDecrypt->getContents()) { - mMsgToDecrypt->setContents(auto_ptr(createInvalidContents(alt))); + mMsgToDecrypt->setContents(unique_ptr(createInvalidContents(alt))); } else { @@ -1022,7 +1022,7 @@ bool EncryptionManager::Decrypt::isSignedRecurse(Contents** contents, { if (*contents == mMsgToDecrypt->getContents()) { - mMsgToDecrypt->setContents(auto_ptr(decrypted)); + mMsgToDecrypt->setContents(unique_ptr(decrypted)); *contents = mMsgToDecrypt->getContents(); } else @@ -1040,7 +1040,7 @@ bool EncryptionManager::Decrypt::isSignedRecurse(Contents** contents, if (*contents == mMsgToDecrypt->getContents()) { - mMsgToDecrypt->setContents(auto_ptr(createInvalidContents(decrypted))); + mMsgToDecrypt->setContents(unique_ptr(createInvalidContents(decrypted))); } else { @@ -1076,7 +1076,7 @@ bool EncryptionManager::Decrypt::isSignedRecurse(Contents** contents, if (*contents == mMsgToDecrypt->getContents()) { - mMsgToDecrypt->setContents(auto_ptr(createInvalidContents(alt))); + mMsgToDecrypt->setContents(unique_ptr(createInvalidContents(alt))); } else { @@ -1127,8 +1127,8 @@ Helper::ContentsSecAttrs EncryptionManager::Decrypt::getContents(SipMessage* mes } } - std::auto_ptr c(contents); - std::auto_ptr a(attr); + std::unique_ptr c(contents); + std::unique_ptr a(attr); return Helper::ContentsSecAttrs(c, a); } @@ -1167,7 +1167,7 @@ Contents* EncryptionManager::Decrypt::getContentsRecurse(Contents** tree, { if (*tree == mMsgToDecrypt->getContents()) { - mMsgToDecrypt->setContents(auto_ptr(contents)); + mMsgToDecrypt->setContents(unique_ptr(contents)); *tree = mMsgToDecrypt->getContents(); } else @@ -1189,7 +1189,7 @@ Contents* EncryptionManager::Decrypt::getContentsRecurse(Contents** tree, if (*tree == mMsgToDecrypt->getContents()) { - mMsgToDecrypt->setContents(auto_ptr(createInvalidContents(contents))); + mMsgToDecrypt->setContents(unique_ptr(createInvalidContents(contents))); } else { @@ -1233,7 +1233,7 @@ Contents* EncryptionManager::Decrypt::getContentsRecurse(Contents** tree, if (*tree == mMsgToDecrypt->getContents()) { - mMsgToDecrypt->setContents(auto_ptr(createInvalidContents(alt))); + mMsgToDecrypt->setContents(unique_ptr(createInvalidContents(alt))); } else { @@ -1272,7 +1272,7 @@ Contents* EncryptionManager::Decrypt::getContentsRecurse(Contents** tree, if (*tree == mMsgToDecrypt->getContents()) { - mMsgToDecrypt->setContents(auto_ptr(createInvalidContents(mult))); + mMsgToDecrypt->setContents(unique_ptr(createInvalidContents(mult))); } else { @@ -1300,7 +1300,7 @@ Contents* EncryptionManager::Decrypt::getContentsRecurse(Contents** tree, if (*tree == mMsgToDecrypt->getContents()) { - mMsgToDecrypt->setContents(auto_ptr(createInvalidContents(*tree))); + mMsgToDecrypt->setContents(unique_ptr(createInvalidContents(*tree))); } else { @@ -1341,7 +1341,7 @@ EncryptionManager::Decrypt::handleInvalidContents() { DebugLog(<< "No valid contents in the request" << endl); InvalidContents* invalid = new InvalidContents(mOriginalMsgContents, mOriginalMsgContentsType); - mMsgToDecrypt->setContents(auto_ptr(invalid)); + mMsgToDecrypt->setContents(unique_ptr(invalid)); } else { @@ -1355,7 +1355,7 @@ EncryptionManager::Decrypt::handleInvalidContents() { DebugLog(<< "No valid contents in the response" << endl); InvalidContents* invalid = new InvalidContents(mOriginalMsgContents, mOriginalMsgContentsType); - mMsgToDecrypt->setContents(auto_ptr(invalid)); + mMsgToDecrypt->setContents(unique_ptr(invalid)); } } diff --git a/src/libs/resiprocate/resip/stack/ConnectionBase.cxx b/src/libs/resiprocate/resip/stack/ConnectionBase.cxx index 2ec53241..512fb48c 100644 --- a/src/libs/resiprocate/resip/stack/ConnectionBase.cxx +++ b/src/libs/resiprocate/resip/stack/ConnectionBase.cxx @@ -403,7 +403,7 @@ ConnectionBase::preparseNewBytes(int bytesRead) // .bwc. This handles all appropriate checking for whether // this is a response or an ACK. - std::auto_ptr tryLater(transport()->make503(*mMessage, expectedWait/1000)); + std::unique_ptr tryLater(transport()->make503(*mMessage, expectedWait/1000)); if(tryLater.get()) { transport()->send(tryLater); @@ -478,7 +478,7 @@ ConnectionBase::preparseNewBytes(int bytesRead) // .bwc. This handles all appropriate checking for whether // this is a response or an ACK. - std::auto_ptr tryLater = transport()->make503(*mMessage, expectedWait/1000); + std::unique_ptr tryLater = transport()->make503(*mMessage, expectedWait/1000); if(tryLater.get()) { transport()->send(tryLater); diff --git a/src/libs/resiprocate/resip/stack/Helper.cxx b/src/libs/resiprocate/resip/stack/Helper.cxx index fb9605a7..72ce4ccf 100644 --- a/src/libs/resiprocate/resip/stack/Helper.cxx +++ b/src/libs/resiprocate/resip/stack/Helper.cxx @@ -116,7 +116,7 @@ unsigned int Helper::hex2integer(const char* _s) SipMessage* Helper::makeRequest(const NameAddr& target, const NameAddr& from, const NameAddr& contact, MethodTypes method) { - std::auto_ptr request(new SipMessage); + std::unique_ptr request(new SipMessage); RequestLine rLine(method); rLine.uri() = target.uri(); request->header(h_To) = target; @@ -153,7 +153,7 @@ Helper::makeRegister(const NameAddr& to, const NameAddr& from) SipMessage* Helper::makeRegister(const NameAddr& to, const NameAddr& from, const NameAddr& contact) { - std::auto_ptr request(new SipMessage); + std::unique_ptr request(new SipMessage); RequestLine rLine(REGISTER); rLine.uri().scheme() = to.uri().scheme(); @@ -192,7 +192,7 @@ Helper::makeRegister(const NameAddr& to,const Data& transport) SipMessage* Helper::makeRegister(const NameAddr& to, const Data& transport, const NameAddr& contact) { - std::auto_ptr request(new SipMessage); + std::unique_ptr request(new SipMessage); RequestLine rLine(REGISTER); rLine.uri().scheme() = to.uri().scheme(); @@ -231,7 +231,7 @@ Helper::makePublish(const NameAddr& target, const NameAddr& from) SipMessage* Helper::makePublish(const NameAddr& target, const NameAddr& from, const NameAddr& contact) { - std::auto_ptr request(new SipMessage); + std::unique_ptr request(new SipMessage); RequestLine rLine(PUBLISH); rLine.uri() = target.uri(); @@ -261,7 +261,7 @@ Helper::makeMessage(const NameAddr& target, const NameAddr& from) SipMessage* Helper::makeMessage(const NameAddr& target, const NameAddr& from, const NameAddr& contact) { - std::auto_ptr request(new SipMessage); + std::unique_ptr request(new SipMessage); RequestLine rLine(MESSAGE); rLine.uri() = target.uri(); @@ -292,7 +292,7 @@ Helper::makeSubscribe(const NameAddr& target, const NameAddr& from) SipMessage* Helper::makeSubscribe(const NameAddr& target, const NameAddr& from, const NameAddr& contact) { - std::auto_ptr request(new SipMessage); + std::unique_ptr request(new SipMessage); RequestLine rLine(SUBSCRIBE); rLine.uri() = target.uri(); @@ -453,7 +453,7 @@ Helper::makeResponse(const SipMessage& request, { // .bwc. Exception safety. Catch/rethrow is dicey because we can't rethrow // resip::BaseException, since it is abstract. - std::auto_ptr response(new SipMessage); + std::unique_ptr response(new SipMessage); makeResponse(*response, request, responseCode, reason, hostname, warning); @@ -475,7 +475,7 @@ Helper::makeResponse(const SipMessage& request, { // .bwc. Exception safety. Catch/rethrow is dicey because we can't rethrow // resip::BaseException, since it is abstract. - std::auto_ptr response(new SipMessage); + std::unique_ptr response(new SipMessage); makeResponse(*response, request, responseCode, reason, hostname, warning); return response.release(); @@ -574,7 +574,7 @@ Helper::makeCancel(const SipMessage& request) { assert(request.isRequest()); assert(request.header(h_RequestLine).getMethod() == INVITE); - std::auto_ptr cancel(new SipMessage); + std::unique_ptr cancel(new SipMessage); RequestLine rLine(CANCEL, request.header(h_RequestLine).getSipVersion()); rLine.uri() = request.header(h_RequestLine).uri(); @@ -611,7 +611,7 @@ Helper::makeFailureAck(const SipMessage& request, const SipMessage& response) assert (request.header(h_Vias).size() >= 1); assert (request.header(h_RequestLine).getMethod() == INVITE); - std::auto_ptr ack(new SipMessage); + std::unique_ptr ack(new SipMessage); RequestLine rLine(ACK, request.header(h_RequestLine).getSipVersion()); rLine.uri() = request.header(h_RequestLine).uri(); @@ -1800,7 +1800,7 @@ Helper::gruuUserPart(const Data& instanceId, sep.size() + 1 + aor.size() ) % 8)) % 8)); - auto_ptr out(new unsigned char[token.size()]); + unique_ptr out(new unsigned char[token.size()]); BF_cbc_encrypt((const unsigned char*)token.data(), out.get(), (long)token.size(), @@ -1840,7 +1840,7 @@ Helper::fromGruuUserPart(const Data& gruuUserPart, const Data decoded = gruu.base64decode(); - auto_ptr out(new unsigned char[gruuUserPart.size()+1]); + unique_ptr out(new unsigned char[gruuUserPart.size()+1]); BF_cbc_encrypt((const unsigned char*)decoded.data(), out.get(), (long)decoded.size(), @@ -1864,8 +1864,8 @@ Helper::ContentsSecAttrs::ContentsSecAttrs() mAttributes(0) {} -Helper::ContentsSecAttrs::ContentsSecAttrs(std::auto_ptr contents, - std::auto_ptr attributes) +Helper::ContentsSecAttrs::ContentsSecAttrs(std::unique_ptr contents, + std::unique_ptr attributes) : mContents(contents), mAttributes(attributes) {} @@ -1990,8 +1990,8 @@ Helper::extractFromPkcs7(const SipMessage& message, b = extractFromPkcs7Recurse(b, toAor, fromAor, attr, security); } } - std::auto_ptr c(b); - std::auto_ptr a(attr); + std::unique_ptr c(b); + std::unique_ptr a(attr); return ContentsSecAttrs(c, a); } @@ -2161,8 +2161,8 @@ SdpContents* getSdpRecurse(Contents* tree) return 0; } -static std::auto_ptr emptysdp; -auto_ptr Helper::getSdp(Contents* tree) +static std::unique_ptr emptysdp; +unique_ptr Helper::getSdp(Contents* tree) { if (tree) { @@ -2171,7 +2171,7 @@ auto_ptr Helper::getSdp(Contents* tree) if (sdp) { DebugLog(<< "Got sdp" << endl); - return auto_ptr(static_cast(sdp->clone())); + return unique_ptr(static_cast(sdp->clone())); } } diff --git a/src/libs/resiprocate/resip/stack/InternalTransport.cxx b/src/libs/resiprocate/resip/stack/InternalTransport.cxx index 2b94a706..f65a6af7 100644 --- a/src/libs/resiprocate/resip/stack/InternalTransport.cxx +++ b/src/libs/resiprocate/resip/stack/InternalTransport.cxx @@ -162,7 +162,7 @@ InternalTransport::hasDataToSend() const } void -InternalTransport::send(std::auto_ptr data) +InternalTransport::send(std::unique_ptr data) { mTxFifo.add(data.release()); } diff --git a/src/libs/resiprocate/resip/stack/SdpContents.cxx b/src/libs/resiprocate/resip/stack/SdpContents.cxx index f2b3d4de..a9d6c74a 100644 --- a/src/libs/resiprocate/resip/stack/SdpContents.cxx +++ b/src/libs/resiprocate/resip/stack/SdpContents.cxx @@ -1837,7 +1837,7 @@ Codec::CodecMap& Codec::getStaticCodecs() // // Build map of static codecs as defined in RFC 3551 // - sStaticCodecs = std::auto_ptr(new CodecMap); + sStaticCodecs = std::unique_ptr(new CodecMap); // Audio codecs sStaticCodecs->insert(make_pair(0,Codec("PCMU",0,8000))); @@ -1907,7 +1907,7 @@ const Codec Codec::FrfDialedDigit("frf-dialed-event",102, 8000); const Codec Codec::CN("CN", 13, 8000); bool Codec::sStaticCodecsCreated = false; -std::auto_ptr Codec::sStaticCodecs; +std::unique_ptr Codec::sStaticCodecs; /* ==================================================================== * The Vovida Software License, Version 1.0 diff --git a/src/libs/resiprocate/resip/stack/SdpContents.hxx b/src/libs/resiprocate/resip/stack/SdpContents.hxx index 05daa73d..2e45f3f9 100644 --- a/src/libs/resiprocate/resip/stack/SdpContents.hxx +++ b/src/libs/resiprocate/resip/stack/SdpContents.hxx @@ -160,7 +160,7 @@ class SdpContents : public Contents Data mParameters; // Format parameters Data mEncodingParameters; - static std::auto_ptr sStaticCodecs; + static std::unique_ptr sStaticCodecs; static bool sStaticCodecsCreated; friend EncodeStream& operator<<(EncodeStream&, const Codec&); }; diff --git a/src/libs/resiprocate/resip/stack/SipMessage.cxx b/src/libs/resiprocate/resip/stack/SipMessage.cxx index 7f944810..b8fd8151 100644 --- a/src/libs/resiprocate/resip/stack/SipMessage.cxx +++ b/src/libs/resiprocate/resip/stack/SipMessage.cxx @@ -970,7 +970,7 @@ SipMessage::setRawBody(const HeaderFieldValue& body) void -SipMessage::setContents(auto_ptr contents) +SipMessage::setContents(unique_ptr contents) { Contents* contentsP = contents.release(); @@ -1020,11 +1020,11 @@ SipMessage::setContents(const Contents* contents) { if (contents) { - setContents(auto_ptr(contents->clone())); + setContents(unique_ptr(contents->clone())); } else { - setContents(auto_ptr(0)); + setContents(unique_ptr(0)); } } @@ -1082,13 +1082,13 @@ SipMessage::getContents() const return mContents; } -auto_ptr +unique_ptr SipMessage::releaseContents() { Contents* c=getContents(); - // .bwc. auto_ptr owns the Contents. No other references allowed! - auto_ptr ret(c ? c->clone() : 0); - setContents(std::auto_ptr(0)); + // .bwc. unique_ptr owns the Contents. No other references allowed! + unique_ptr ret(c ? c->clone() : 0); + setContents(std::unique_ptr(0)); if (ret.get() != 0 && !ret->isWellFormed()) { @@ -1692,7 +1692,7 @@ SipMessage::mergeUri(const Uri& source) } void -SipMessage::setSecurityAttributes(auto_ptr sec) +SipMessage::setSecurityAttributes(unique_ptr sec) { mSecurityAttributes = sec; } @@ -1746,7 +1746,7 @@ SipMessage::copyOutboundDecoratorsToStackCancel(SipMessage& cancel) { if((*i)->copyToStackCancels()) { - cancel.addOutboundDecorator(*(new auto_ptr((*i)->clone()))); + cancel.addOutboundDecorator(*(new unique_ptr((*i)->clone()))); } } } @@ -1760,7 +1760,7 @@ SipMessage::copyOutboundDecoratorsToStackFailureAck(SipMessage& ack) { if((*i)->copyToStackFailureAcks()) { - ack.addOutboundDecorator(*(new auto_ptr((*i)->clone()))); + ack.addOutboundDecorator(*(new unique_ptr((*i)->clone()))); } } } diff --git a/src/libs/resiprocate/resip/stack/SipMessage.hxx b/src/libs/resiprocate/resip/stack/SipMessage.hxx index 9b38c4db..fcb516d6 100644 --- a/src/libs/resiprocate/resip/stack/SipMessage.hxx +++ b/src/libs/resiprocate/resip/stack/SipMessage.hxx @@ -461,14 +461,14 @@ class SipMessage : public TransactionMessage **/ Contents* getContents() const; /// Removes the contents from the message - std::auto_ptr releaseContents(); + std::unique_ptr releaseContents(); /// @brief Set the contents of the message /// @param contents to store in the message void setContents(const Contents* contents); /// @brief Set the contents of the message /// @param contents to store in the message - void setContents(std::auto_ptr contents); + void setContents(std::unique_ptr contents); /// @internal transport interface void setStartLine(const char* start, int len); @@ -516,12 +516,12 @@ class SipMessage : public TransactionMessage SipMessage& mergeUri(const Uri& source); - void setSecurityAttributes(std::auto_ptr); + void setSecurityAttributes(std::unique_ptr); const SecurityAttributes* getSecurityAttributes() const { return mSecurityAttributes.get(); } /// @brief Call a MessageDecorator to process the message before it is /// sent to the transport - void addOutboundDecorator(std::auto_ptr md){mOutboundDecorators.push_back(md.release());} + void addOutboundDecorator(std::unique_ptr md){mOutboundDecorators.push_back(md.release());} void clearOutboundDecorators(); void callOutboundDecorators(const Tuple &src, const Tuple &dest, @@ -677,7 +677,7 @@ class SipMessage : public TransactionMessage // peers domain associate with this message (MTLS) std::list mTlsPeerNames; - std::auto_ptr mSecurityAttributes; + std::unique_ptr mSecurityAttributes; std::vector mOutboundDecorators; diff --git a/src/libs/resiprocate/resip/stack/SipStack.cxx b/src/libs/resiprocate/resip/stack/SipStack.cxx index 55bb9f49..56bad5cd 100644 --- a/src/libs/resiprocate/resip/stack/SipStack.cxx +++ b/src/libs/resiprocate/resip/stack/SipStack.cxx @@ -389,12 +389,12 @@ SipStack::addTransport( TransportType protocol, << ": " << e); throw; } - addTransport(std::auto_ptr(transport)); + addTransport(std::unique_ptr(transport)); return transport; } void -SipStack::addTransport(std::auto_ptr transport) +SipStack::addTransport(std::unique_ptr transport) { //.dcm. once addTransport starts throwing, need to back out alias if (!transport->interfaceName().empty()) @@ -566,7 +566,7 @@ SipStack::send(const SipMessage& msg, TransactionUser* tu) } void -SipStack::send(std::auto_ptr msg, TransactionUser* tu) +SipStack::send(std::unique_ptr msg, TransactionUser* tu) { DebugLog (<< "SEND: " << msg->brief()); @@ -580,7 +580,7 @@ SipStack::send(std::auto_ptr msg, TransactionUser* tu) } void -SipStack::sendTo(std::auto_ptr msg, const Uri& uri, TransactionUser* tu) +SipStack::sendTo(std::unique_ptr msg, const Uri& uri, TransactionUser* tu) { if (tu) msg->setTransactionUser(tu); msg->setForceTarget(uri); @@ -590,7 +590,7 @@ SipStack::sendTo(std::auto_ptr msg, const Uri& uri, TransactionUser* } void -SipStack::sendTo(std::auto_ptr msg, const Tuple& destination, TransactionUser* tu) +SipStack::sendTo(std::unique_ptr msg, const Tuple& destination, TransactionUser* tu) { assert(!mShuttingDown); @@ -641,7 +641,7 @@ SipStack::checkAsyncProcessHandler() } void -SipStack::post(std::auto_ptr message) +SipStack::post(std::unique_ptr message) { assert(!mShuttingDown); mTuSelector.add(message.release(), TimeLimitFifo::InternalElement); @@ -678,7 +678,7 @@ SipStack::postMS(const ApplicationMessage& message, unsigned int ms, } void -SipStack::post(std::auto_ptr message, +SipStack::post(std::unique_ptr message, unsigned int secondsLater, TransactionUser* tu) { @@ -687,7 +687,7 @@ SipStack::post(std::auto_ptr message, void -SipStack::postMS( std::auto_ptr message, +SipStack::postMS( std::unique_ptr message, unsigned int ms, TransactionUser* tu) { diff --git a/src/libs/resiprocate/resip/stack/TransactionState.cxx b/src/libs/resiprocate/resip/stack/TransactionState.cxx index 868b4a31..8d24889e 100644 --- a/src/libs/resiprocate/resip/stack/TransactionState.cxx +++ b/src/libs/resiprocate/resip/stack/TransactionState.cxx @@ -929,9 +929,9 @@ TransactionState::saveOriginalContactAndVia(const SipMessage& sip) if(sip.exists(h_Contacts) && sip.const_header(h_Contacts).size() == 1 && sip.const_header(h_Contacts).front().isWellFormed()) { - mOriginalContact = std::auto_ptr(new NameAddr(sip.header(h_Contacts).front())); + mOriginalContact = std::unique_ptr(new NameAddr(sip.header(h_Contacts).front())); } - mOriginalVia = std::auto_ptr(new Via(sip.header(h_Vias).front())); + mOriginalVia = std::unique_ptr(new Via(sip.header(h_Vias).front())); } void TransactionState::restoreOriginalContactAndVia() diff --git a/src/libs/resiprocate/resip/stack/Transport.cxx b/src/libs/resiprocate/resip/stack/Transport.cxx index 4a537726..8dab9e05 100644 --- a/src/libs/resiprocate/resip/stack/Transport.cxx +++ b/src/libs/resiprocate/resip/stack/Transport.cxx @@ -224,11 +224,11 @@ Transport::fail(const Data& tid, TransportFailure::FailureReason reason, int sub } } -std::auto_ptr +std::unique_ptr Transport::makeSendData( const Tuple& dest, const Data& d, const Data& tid, const Data &sigcompId) { assert(dest.getPort() != -1); - std::auto_ptr data(new SendData(dest, d, tid, sigcompId)); + std::unique_ptr data(new SendData(dest, d, tid, sigcompId)); return data; } @@ -241,7 +241,7 @@ Transport::makeFailedResponse(const SipMessage& msg, const Tuple& dest = msg.getSource(); - std::auto_ptr errMsg(Helper::makeResponse(msg, + std::unique_ptr errMsg(Helper::makeResponse(msg, responseCode, warning ? warning : "Original request had no Vias")); @@ -259,13 +259,13 @@ Transport::makeFailedResponse(const SipMessage& msg, // Calculate compartment ID for outbound message Data remoteSigcompId; setRemoteSigcompId(*errMsg,remoteSigcompId); - send(std::auto_ptr(makeSendData(dest, encoded, Data::Empty, remoteSigcompId))); + send(std::unique_ptr(makeSendData(dest, encoded, Data::Empty, remoteSigcompId))); } -std::auto_ptr +std::unique_ptr Transport::make503(SipMessage& msg, UInt16 retryAfter) { - std::auto_ptr result; + std::unique_ptr result; if (msg.isResponse()) return result; try @@ -296,10 +296,10 @@ Transport::make503(SipMessage& msg, UInt16 retryAfter) return result; } -std::auto_ptr +std::unique_ptr Transport::make100(SipMessage& msg) { - std::auto_ptr result; + std::unique_ptr result; if (msg.isResponse()) return result; try diff --git a/src/libs/resiprocate/resip/stack/TransportSelector.cxx b/src/libs/resiprocate/resip/stack/TransportSelector.cxx index 58fc9280..0bcc480d 100644 --- a/src/libs/resiprocate/resip/stack/TransportSelector.cxx +++ b/src/libs/resiprocate/resip/stack/TransportSelector.cxx @@ -162,7 +162,7 @@ TransportSelector::isFinished() const } void -TransportSelector::addTransport(std::auto_ptr autoTransport, +TransportSelector::addTransport(std::unique_ptr autoTransport, bool immediate) { if(immediate) @@ -176,7 +176,7 @@ TransportSelector::addTransport(std::auto_ptr autoTransport, } void -TransportSelector::addTransportInternal(std::auto_ptr autoTransport) +TransportSelector::addTransportInternal(std::unique_ptr autoTransport) { Transport* transport = autoTransport.release(); mDns.addTransportType(transport->transport(), transport->ipVersion()); @@ -370,7 +370,7 @@ TransportSelector::process() void TransportSelector::checkTransportAddQueue() { - std::auto_ptr t(mTransportsToAdd.getNext(-1)); + std::unique_ptr t(mTransportsToAdd.getNext(-1)); while(t.get()) { addTransportInternal(t); @@ -1138,7 +1138,7 @@ TransportSelector::transmit(SipMessage* msg, Tuple& target, SendData* sendData) // Call back anyone who wants to perform outbound decoration msg->callOutboundDecorators(source, target,remoteSigcompId); - std::auto_ptr send(new SendData(target, + std::unique_ptr send(new SendData(target, resip::Data::Empty, msg->getTransactionId(), remoteSigcompId)); @@ -1217,7 +1217,7 @@ TransportSelector::retransmit(const SendData& data) if(transport) { // If this is not true, it means the transport has been removed. - transport->send(std::auto_ptr(data.clone())); + transport->send(std::unique_ptr(data.clone())); } } @@ -1232,7 +1232,7 @@ TransportSelector::closeConnection(const Tuple& peer) resip::Data::Empty, resip::Data::Empty); close->command = SendData::CloseConnection; - t->send(std::auto_ptr(close)); + t->send(std::unique_ptr(close)); } } @@ -1279,7 +1279,7 @@ TransportSelector::enableFlowTimer(const resip::Tuple& flow) resip::Data::Empty, resip::Data::Empty); enableFlowTimer->command = SendData::EnableFlowTimer; - t->send(std::auto_ptr(enableFlowTimer)); + t->send(std::unique_ptr(enableFlowTimer)); } } diff --git a/src/libs/resiprocate/resip/stack/TuIM.cxx b/src/libs/resiprocate/resip/stack/TuIM.cxx index c5d559bd..1c1a19c7 100644 --- a/src/libs/resiprocate/resip/stack/TuIM.cxx +++ b/src/libs/resiprocate/resip/stack/TuIM.cxx @@ -143,7 +143,7 @@ TuIM::sendPage(const Data& text, const Uri& dest, DeprecatedDialog* dialog = new DeprecatedDialog( NameAddr(mContact) ); - auto_ptr msg( dialog->makeInitialMessage(NameAddr(target),NameAddr(from)) ); + unique_ptr msg( dialog->makeInitialMessage(NameAddr(target),NameAddr(from)) ); Page page; page.text = text; @@ -411,7 +411,7 @@ TuIM::processSubscribeRequest(SipMessage* msg) assert( dialog ); dialog->setExpirySeconds( expires ); - auto_ptr response( dialog->makeResponse( *msg, 200 )); + unique_ptr response( dialog->makeResponse( *msg, 200 )); response->header(h_Expires).value() = expires; response->header(h_Event).value() = Data("presence"); @@ -504,7 +504,7 @@ TuIM::processNotifyRequest(SipMessage* msg) processSipFrag( msg ); - auto_ptr response( Helper::makeResponse( *msg, 200 )); + unique_ptr response( Helper::makeResponse( *msg, 200 )); mStack->send( *response ); Uri from = msg->header(h_From).uri(); @@ -1110,7 +1110,7 @@ TuIM::process() { if ( mRegistrationDialog.isCreated() ) { - auto_ptr msg( mRegistrationDialog.makeRegister() ); + unique_ptr msg( mRegistrationDialog.makeRegister() ); msg->header(h_Expires).value() = mRegistrationTimeSeconds; setOutbound( *msg ); mStack->send( *msg ); @@ -1131,7 +1131,7 @@ TuIM::process() assert( buddy.presDialog ); if ( buddy.presDialog->isCreated() ) { - auto_ptr msg( buddy.presDialog->makeSubscribe() ); + unique_ptr msg( buddy.presDialog->makeSubscribe() ); msg->header(h_Event).value() = Data("presence");; msg->header(h_Accepts).push_back( Mime( "application","pidf+xml") ); @@ -1183,7 +1183,7 @@ TuIM::registerAor( const Uri& uri, const Data& password ) //contactName.uri() = mContact; //SipMessage* msg = Helper::makeRegister(aorName,aorName,contactName); - auto_ptr msg( mRegistrationDialog.makeInitialRegister(NameAddr(uri),NameAddr(uri)) ); + unique_ptr msg( mRegistrationDialog.makeInitialRegister(NameAddr(uri),NameAddr(uri)) ); msg->header(h_Expires).value() = mRegistrationTimeSeconds; msg->header(h_Contacts).front().param(p_expires) = mRegistrationTimeSeconds; @@ -1248,7 +1248,7 @@ void TuIM::subscribeBuddy( Buddy& buddy ) { // subscribe to this budy - auto_ptr msg( buddy.presDialog->makeInitialSubscribe(NameAddr(buddy.uri),NameAddr(mAor)) ); + unique_ptr msg( buddy.presDialog->makeInitialSubscribe(NameAddr(buddy.uri),NameAddr(mAor)) ); msg->header(h_Event).value() = Data("presence");; msg->header(h_Accepts).push_back( Mime( "application","pidf+xml") ); @@ -1308,7 +1308,7 @@ TuIM::sendNotify(DeprecatedDialog* dialog) { assert( dialog ); - auto_ptr msg( dialog->makeNotify() ); + unique_ptr msg( dialog->makeNotify() ); Pidf* pidf = new Pidf( *mPidf ); @@ -1332,7 +1332,7 @@ TuIM::sendPublish(StateAgent& sa) { assert( sa.dialog ); - auto_ptr msg( sa.dialog->makeInitialPublish(NameAddr(sa.uri),NameAddr(mAor)) ); + unique_ptr msg( sa.dialog->makeInitialPublish(NameAddr(sa.uri),NameAddr(mAor)) ); Pidf* pidf = new Pidf( *mPidf ); diff --git a/src/libs/resiprocate/resip/stack/UdpTransport.cxx b/src/libs/resiprocate/resip/stack/UdpTransport.cxx index 2c542dde..bbfe2778 100644 --- a/src/libs/resiprocate/resip/stack/UdpTransport.cxx +++ b/src/libs/resiprocate/resip/stack/UdpTransport.cxx @@ -237,7 +237,7 @@ UdpTransport::processTxOne(SendData *data) { ++mTxMsgCnt; assert(data); - std::auto_ptr sendData(data); + std::unique_ptr sendData(data); //DebugLog (<< "Sent: " << sendData->data); //DebugLog (<< "Sending message on udp."); assert( sendData->destination.getPort() != 0 ); @@ -598,7 +598,7 @@ UdpTransport::processRxParse(char *buffer, int len, Tuple& sender) StackLog(<< Data(Data::Borrow, buffer, len)); if(mExternalUnknownDatagramHandler) { - auto_ptr datagram(new Data(buffer,len)); + unique_ptr datagram(new Data(buffer,len)); (*mExternalUnknownDatagramHandler)(this,sender,datagram); } @@ -640,7 +640,7 @@ UdpTransport::processRxParse(char *buffer, int len, Tuple& sender) // .bwc. This handles all appropriate checking for whether // this is a response or an ACK. - std::auto_ptr tryLater(make503(*message, getExpectedWaitForIncoming()/1000)); + std::unique_ptr tryLater(make503(*message, getExpectedWaitForIncoming()/1000)); if(tryLater.get()) { send(tryLater); diff --git a/src/libs/resiprocate/resip/stack/Uri.hxx b/src/libs/resiprocate/resip/stack/Uri.hxx index cdcb5fc4..dc8f6b99 100644 --- a/src/libs/resiprocate/resip/stack/Uri.hxx +++ b/src/libs/resiprocate/resip/stack/Uri.hxx @@ -264,8 +264,8 @@ class Uri : public ParserCategory mutable bool mHostCanonicalized; private: - std::auto_ptr mEmbeddedHeadersText; - std::auto_ptr mEmbeddedHeaders; + std::unique_ptr mEmbeddedHeadersText; + std::unique_ptr mEmbeddedHeaders; static ParameterTypes::Factory ParameterFactories[ParameterTypes::MAX_PARAMETER]; diff --git a/src/libs/resiprocate/resip/stack/ssl/Security.cxx b/src/libs/resiprocate/resip/stack/ssl/Security.cxx index b90395af..0597f110 100644 --- a/src/libs/resiprocate/resip/stack/ssl/Security.cxx +++ b/src/libs/resiprocate/resip/stack/ssl/Security.cxx @@ -1857,7 +1857,7 @@ BaseSecurity::checkIdentity( const Data& signerDomain, const Data& in, const Dat void BaseSecurity::checkAndSetIdentity(SipMessage& msg, const Data& certDer) const { - auto_ptr sec(new SecurityAttributes); + unique_ptr sec(new SecurityAttributes); X509* cert=NULL; try