You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by kg...@apache.org on 2011/08/04 20:45:17 UTC
svn commit: r1153966 - in /qpid/trunk/qpid/cpp/src/qpid/broker:
SessionState.cpp SessionState.h
Author: kgiusti
Date: Thu Aug 4 18:45:16 2011
New Revision: 1153966
URL: http://svn.apache.org/viewvc?rev=1153966&view=rev
Log:
QPID-3394: move object copy after changing object state, not before.
Modified:
qpid/trunk/qpid/cpp/src/qpid/broker/SessionState.cpp
qpid/trunk/qpid/cpp/src/qpid/broker/SessionState.h
Modified: qpid/trunk/qpid/cpp/src/qpid/broker/SessionState.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/SessionState.cpp?rev=1153966&r1=1153965&r2=1153966&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/SessionState.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/SessionState.cpp Thu Aug 4 18:45:16 2011
@@ -445,8 +445,6 @@ void SessionState::addPendingExecutionSy
boost::intrusive_ptr<AsyncCompletion::Callback>
SessionState::IncompleteIngressMsgXfer::clone()
{
- boost::intrusive_ptr<SessionState::IncompleteIngressMsgXfer> cb(new SessionState::IncompleteIngressMsgXfer(session, msg));
-
// Optimization: this routine is *only* invoked when the message needs to be asynchronously completed.
// If the client is pending the message.transfer completion, flush now to force immediate write to journal.
if (requiresSync)
@@ -457,7 +455,8 @@ SessionState::IncompleteIngressMsgXfer::
pending = true;
completerContext->addPendingMessage(msg);
}
- return cb;
+
+ return boost::intrusive_ptr<SessionState::IncompleteIngressMsgXfer>(new SessionState::IncompleteIngressMsgXfer(*this));
}
Modified: qpid/trunk/qpid/cpp/src/qpid/broker/SessionState.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/SessionState.h?rev=1153966&r1=1153965&r2=1153966&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/SessionState.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/SessionState.h Thu Aug 4 18:45:16 2011
@@ -256,7 +256,15 @@ class SessionState : public qpid::Sessio
requiresAccept(m->requiresAccept()),
requiresSync(m->getFrames().getMethod()->isSync()),
pending(false) {}
- virtual ~IncompleteIngressMsgXfer() {};
+ IncompleteIngressMsgXfer( const IncompleteIngressMsgXfer& x )
+ : AsyncCommandContext(x.session, x.msg->getCommandId()),
+ session(x.session),
+ msg(x.msg),
+ requiresAccept(x.requiresAccept),
+ requiresSync(x.requiresSync),
+ pending(x.pending) {}
+
+ virtual ~IncompleteIngressMsgXfer() {};
virtual void completed(bool);
virtual boost::intrusive_ptr<AsyncCompletion::Callback> clone();
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org