summaryrefslogtreecommitdiff
path: root/qpid/cpp/src
diff options
context:
space:
mode:
authorTed Ross <tross@apache.org>2009-01-21 18:42:16 +0000
committerTed Ross <tross@apache.org>2009-01-21 18:42:16 +0000
commitb08609e20157b73eabdcc7fef5071d15ee016efc (patch)
tree1d124f3f6c2e35bbda9babcc7d98f10039b9d6a3 /qpid/cpp/src
parent6ccb74bc1e1625471898882eef67d420a9e51995 (diff)
downloadqpid-python-b08609e20157b73eabdcc7fef5071d15ee016efc.tar.gz
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@736370 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src')
-rw-r--r--qpid/cpp/src/qpid/broker/ConnectionState.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/qpid/cpp/src/qpid/broker/ConnectionState.h b/qpid/cpp/src/qpid/broker/ConnectionState.h
index c4c75833bf..373b7d868a 100644
--- a/qpid/cpp/src/qpid/broker/ConnectionState.h
+++ b/qpid/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; }