From d4838b1db929de6d650b7cdf574c04425c01b38d Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Thu, 1 Nov 2007 00:38:58 +0000 Subject: Preparation for session thread safety overhaul: - simplified SessionState, responsibility for protocol states now in Handlers - qpid::RefCounted, qpid::intrusive_ptr reference counting support. - build boost unit tests as single exe, speeds up testing. - fixed leak in AsynchIOAcceptor.cpp git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@590869 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/broker/SessionHandler.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'cpp/src/qpid/broker/SessionHandler.cpp') diff --git a/cpp/src/qpid/broker/SessionHandler.cpp b/cpp/src/qpid/broker/SessionHandler.cpp index 0dafcba7bd..f72c52c809 100644 --- a/cpp/src/qpid/broker/SessionHandler.cpp +++ b/cpp/src/qpid/broker/SessionHandler.cpp @@ -38,8 +38,7 @@ SessionHandler::SessionHandler(Connection& c, ChannelId ch) connection(c), channel(ch, &c.getOutput()), proxy(out), // Via my own handleOut() for L2 data. peerSession(channel), // Direct to channel for L2 commands. - ignoring(false), - resuming(false) {} + ignoring(false) {} SessionHandler::~SessionHandler() {} @@ -117,8 +116,7 @@ void SessionHandler::resume(const Uuid& id) { assertClosed("resume"); session = connection.broker.getSessionManager().resume(id); session->attach(*this); - resuming=true; - SequenceNumber seq = session->sendingAck(); + SequenceNumber seq = session->resuming(); peerSession.attached(session->getId(), session->getTimeout()); proxy.getSession().ack(seq, SequenceNumberSet()); } @@ -171,8 +169,7 @@ void SessionHandler::ack(uint32_t cumulativeSeenMark, const SequenceNumberSet& /*seenFrameSet*/) { assertAttached("ack"); - if (resuming) { - resuming=false; + if (session->getState() == SessionState::RESUMING) { session->receivedAck(cumulativeSeenMark); framing::SessionState::Replay replay=session->replay(); std::for_each(replay.begin(), replay.end(), -- cgit v1.2.1