diff options
author | Gordon Sim <gsim@apache.org> | 2007-11-28 13:28:21 +0000 |
---|---|---|
committer | Gordon Sim <gsim@apache.org> | 2007-11-28 13:28:21 +0000 |
commit | 8e3ec1e93a84fcc0dac67639293b6f80bec21417 (patch) | |
tree | 03da8bc9a4f9e57a430d3761b6fbe4f9ba7a7872 /cpp | |
parent | 21e1355c2565e8e348233f582d49be3f69460890 (diff) | |
download | qpid-python-8e3ec1e93a84fcc0dac67639293b6f80bec21417.tar.gz |
Disable recoding of frames for replay where replay will not be required.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@598992 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/src/qpid/broker/SessionState.cpp | 2 | ||||
-rw-r--r-- | cpp/src/qpid/client/SessionCore.cpp | 2 | ||||
-rw-r--r-- | cpp/src/qpid/framing/SessionState.cpp | 4 | ||||
-rw-r--r-- | cpp/src/qpid/framing/SessionState.h | 2 | ||||
-rw-r--r-- | cpp/src/tests/ClientSessionTest.cpp | 2 |
5 files changed, 6 insertions, 6 deletions
diff --git a/cpp/src/qpid/broker/SessionState.cpp b/cpp/src/qpid/broker/SessionState.cpp index ebf02a8306..27658f2c84 100644 --- a/cpp/src/qpid/broker/SessionState.cpp +++ b/cpp/src/qpid/broker/SessionState.cpp @@ -40,7 +40,7 @@ void SessionState::handleOut(AMQFrame& f) { SessionState::SessionState( SessionManager& f, SessionHandler& h, uint32_t timeout_, uint32_t ack) - : framing::SessionState(ack), + : framing::SessionState(ack, timeout_ > 0), factory(f), handler(&h), id(true), timeout(timeout_), broker(h.getConnection().broker), version(h.getConnection().getVersion()), diff --git a/cpp/src/qpid/client/SessionCore.cpp b/cpp/src/qpid/client/SessionCore.cpp index 3a26734892..ea32622ba1 100644 --- a/cpp/src/qpid/client/SessionCore.cpp +++ b/cpp/src/qpid/client/SessionCore.cpp @@ -246,7 +246,7 @@ void SessionCore::attached(const Uuid& sessionId, if (state==OPENING) { // New session // FIXME aconway 2007-10-17: arbitrary ack value of 100 for // client, allow configuration. - session=in_place<SessionState>(100, sessionId); + session=in_place<SessionState>(100, detachedLifetime > 0, sessionId); setState(OPEN); } else { // RESUMING diff --git a/cpp/src/qpid/framing/SessionState.cpp b/cpp/src/qpid/framing/SessionState.cpp index 52b71d0cf9..f9019b036c 100644 --- a/cpp/src/qpid/framing/SessionState.cpp +++ b/cpp/src/qpid/framing/SessionState.cpp @@ -32,7 +32,7 @@ namespace qpid { namespace framing { -SessionState::SessionState(uint32_t ack, const Uuid& uuid) : +SessionState::SessionState(uint32_t ack, bool enableReplay, const Uuid& uuid) : state(ATTACHED), id(uuid), lastReceived(-1), @@ -41,7 +41,7 @@ SessionState::SessionState(uint32_t ack, const Uuid& uuid) : sendAckAt(lastReceived+ackInterval), solicitAckAt(lastSent+ackInterval), ackSolicited(false), - resumable(true) + resumable(enableReplay) {} SessionState::SessionState(const Uuid& uuid) : diff --git a/cpp/src/qpid/framing/SessionState.h b/cpp/src/qpid/framing/SessionState.h index 7a12c2ac9a..066bece003 100644 --- a/cpp/src/qpid/framing/SessionState.h +++ b/cpp/src/qpid/framing/SessionState.h @@ -61,7 +61,7 @@ class SessionState * * N=0 disables voluntary send/solict ack. */ - SessionState(uint32_t ackInterval, const framing::Uuid& id=framing::Uuid(true)); + SessionState(uint32_t ackInterval, bool enableReplay = true, const framing::Uuid& id=framing::Uuid(true)); /** * Create a non-resumable session. Does not store session frames, diff --git a/cpp/src/tests/ClientSessionTest.cpp b/cpp/src/tests/ClientSessionTest.cpp index 5d87e1f76b..ac2cf155f4 100644 --- a/cpp/src/tests/ClientSessionTest.cpp +++ b/cpp/src/tests/ClientSessionTest.cpp @@ -166,7 +166,7 @@ public: try { c->resume(session); CPPUNIT_FAIL("Expected InvalidArgumentException."); - } catch(const InvalidArgumentException&) {} + } catch(const InternalErrorException&) {} } void testUseSuspendedError() { |