diff options
author | Alan Conway <aconway@apache.org> | 2007-10-31 16:56:57 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2007-10-31 16:56:57 +0000 |
commit | ff6f9f47dbbaaf84dde2a86dd8f854fcf3060378 (patch) | |
tree | e5474e9e0d23cec834b06c99cdaf9d4a98b1a0b5 /cpp/src/qpid/broker/SessionHandler.cpp | |
parent | 3d05570dc824c704285bfef1ff810fbb1589f596 (diff) | |
download | qpid-python-ff6f9f47dbbaaf84dde2a86dd8f854fcf3060378.tar.gz |
Simplify SessionState, preparing for session thread safety fixes.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@590751 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/SessionHandler.cpp')
-rw-r--r-- | cpp/src/qpid/broker/SessionHandler.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/cpp/src/qpid/broker/SessionHandler.cpp b/cpp/src/qpid/broker/SessionHandler.cpp index 49492ffed1..1d0e67f6ab 100644 --- a/cpp/src/qpid/broker/SessionHandler.cpp +++ b/cpp/src/qpid/broker/SessionHandler.cpp @@ -38,7 +38,8 @@ 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) {} + ignoring(false), + resuming(false) {} SessionHandler::~SessionHandler() {} @@ -114,7 +115,8 @@ void SessionHandler::resume(const Uuid& id) { assertClosed("resume"); session = connection.broker.getSessionManager().resume(id); session->attach(*this); - SequenceNumber seq = session->resuming(); + resuming=true; + SequenceNumber seq = session->sendingAck(); peerSession.attached(session->getId(), session->getTimeout()); proxy.getSession().ack(seq, SequenceNumberSet()); } @@ -148,7 +150,7 @@ void SessionHandler::closed(uint16_t replyCode, const string& replyText) { } void SessionHandler::localSuspend() { - if (session.get() && session->getState() == SessionState::ATTACHED) { + if (session.get()) { session->detach(); connection.broker.getSessionManager().suspend(session); } @@ -166,7 +168,8 @@ void SessionHandler::ack(uint32_t cumulativeSeenMark, const SequenceNumberSet& /*seenFrameSet*/) { assertAttached("ack"); - if (session->getState() == SessionState::RESUMING) { + if (resuming) { + resuming=false; session->receivedAck(cumulativeSeenMark); framing::SessionState::Replay replay=session->replay(); std::for_each(replay.begin(), replay.end(), |