From 6878134a26bf5b3e9a2b28c9886cb05f47b5718b Mon Sep 17 00:00:00 2001 From: Ted Ross Date: Wed, 21 Jan 2009 18:42:16 +0000 Subject: Enforce a minimum frame-max to avoid really bad things that can happen if frame-max is set to zero. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@736370 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/broker/ConnectionState.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'cpp/src') diff --git a/cpp/src/qpid/broker/ConnectionState.h b/cpp/src/qpid/broker/ConnectionState.h index c4c75833bf..373b7d868a 100644 --- a/cpp/src/qpid/broker/ConnectionState.h +++ b/cpp/src/qpid/broker/ConnectionState.h @@ -35,6 +35,9 @@ namespace broker { class ConnectionState : public ConnectionToken, public management::Manageable { + // Minimum allowed frameMax + static const uint32_t MIN_FRAME_MAX = 4096; + protected: sys::ConnectionOutputHandlerPtr out; @@ -50,8 +53,6 @@ class ConnectionState : public ConnectionToken, public management::Manageable federationLink(true) {} - - virtual ~ConnectionState () {} uint32_t getFrameMax() const { return framemax; } @@ -59,7 +60,7 @@ class ConnectionState : public ConnectionToken, public management::Manageable uint16_t getHeartbeatMax() const { return heartbeatmax; } uint64_t getStagingThreshold() const { return stagingThreshold; } - void setFrameMax(uint32_t fm) { framemax = fm; } + void setFrameMax(uint32_t fm) { framemax = std::max(fm, MIN_FRAME_MAX); } void setHeartbeat(uint16_t hb) { heartbeat = hb; } void setHeartbeatMax(uint16_t hbm) { heartbeatmax = hbm; } void setStagingThreshold(uint64_t st) { stagingThreshold = st; } -- cgit v1.2.1