diff options
author | Gordon Sim <gsim@apache.org> | 2007-12-18 16:58:23 +0000 |
---|---|---|
committer | Gordon Sim <gsim@apache.org> | 2007-12-18 16:58:23 +0000 |
commit | 29a99ba263cd32b4bc6510ef748d77abc143227c (patch) | |
tree | a570a686b1804a56c54873af0c2ce51284ab13e2 /cpp | |
parent | a1643ff7395fec6c46d2cd08c5fda7a8d0cfa99a (diff) | |
download | qpid-python-29a99ba263cd32b4bc6510ef748d77abc143227c.tar.gz |
Fixes to max frame size default and fragmentation on broker.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@605251 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/src/qpid/broker/Connection.cpp | 2 | ||||
-rw-r--r-- | cpp/src/qpid/client/Connection.cpp | 2 | ||||
-rw-r--r-- | cpp/src/qpid/client/Connection.h | 4 | ||||
-rw-r--r-- | cpp/src/qpid/client/ConnectionHandler.cpp | 2 | ||||
-rw-r--r-- | cpp/src/qpid/client/ExecutionHandler.cpp | 2 | ||||
-rw-r--r-- | cpp/src/qpid/client/ExecutionHandler.h | 2 | ||||
-rw-r--r-- | cpp/src/qpid/framing/SendContent.cpp | 4 |
7 files changed, 10 insertions, 8 deletions
diff --git a/cpp/src/qpid/broker/Connection.cpp b/cpp/src/qpid/broker/Connection.cpp index 4f0eeaa21a..f2cd1c11e4 100644 --- a/cpp/src/qpid/broker/Connection.cpp +++ b/cpp/src/qpid/broker/Connection.cpp @@ -46,7 +46,7 @@ Connection::Connection(ConnectionOutputHandler* out_, Broker& broker_) : broker(broker_), outputTasks(*out_), out(out_), - framemax(65536), + framemax(65535), heartbeat(0), client(0), stagingThreshold(broker.getStagingThreshold()), diff --git a/cpp/src/qpid/client/Connection.cpp b/cpp/src/qpid/client/Connection.cpp index 3210b29104..b2508f4a24 100644 --- a/cpp/src/qpid/client/Connection.cpp +++ b/cpp/src/qpid/client/Connection.cpp @@ -51,7 +51,7 @@ Connection::Connection(bool _debug, uint32_t _max_frame_size, framing::ProtocolV Connection::Connection(shared_ptr<Connector> c) : channelIdCounter(0), version(framing::highestProtocolVersion), - max_frame_size(65536), + max_frame_size(65535), isOpen(false), impl(new ConnectionImpl(c)) {} diff --git a/cpp/src/qpid/client/Connection.h b/cpp/src/qpid/client/Connection.h index 32b2200f25..053949a51b 100644 --- a/cpp/src/qpid/client/Connection.h +++ b/cpp/src/qpid/client/Connection.h @@ -74,9 +74,9 @@ class Connection * out). Optional and defaults to false. * * @param max_frame_size the maximum frame size that the - * client will accept. Optional and defaults to 65536. + * client will accept. Optional and defaults to 65535. */ - Connection(bool debug = false, uint32_t max_frame_size = 65536, + Connection(bool debug = false, uint32_t max_frame_size = 65535, framing::ProtocolVersion=framing::highestProtocolVersion); Connection(boost::shared_ptr<Connector>); ~Connection(); diff --git a/cpp/src/qpid/client/ConnectionHandler.cpp b/cpp/src/qpid/client/ConnectionHandler.cpp index 6a07548378..84b0768c27 100644 --- a/cpp/src/qpid/client/ConnectionHandler.cpp +++ b/cpp/src/qpid/client/ConnectionHandler.cpp @@ -41,7 +41,7 @@ ConnectionHandler::ConnectionHandler() locale = "en_US"; heartbeat = 0; maxChannels = 32767; - maxFrameSize = 65536; + maxFrameSize = 65535; insist = true; version = framing::highestProtocolVersion; diff --git a/cpp/src/qpid/client/ExecutionHandler.cpp b/cpp/src/qpid/client/ExecutionHandler.cpp index 85e646416c..ba3cdce636 100644 --- a/cpp/src/qpid/client/ExecutionHandler.cpp +++ b/cpp/src/qpid/client/ExecutionHandler.cpp @@ -206,7 +206,7 @@ void ExecutionHandler::sendContent(const MethodContent& content) if(data_length > 0){ header.setEof(false); out(header); - u_int32_t frag_size = maxFrameSize - (AMQFrame::frameOverhead() - 1 /*end of frame marker included in overhead but not in size*/); + const u_int32_t frag_size = maxFrameSize - (AMQFrame::frameOverhead() - 1 /*end of frame marker included in overhead but not in size*/); if(data_length < frag_size){ AMQFrame frame(in_place<AMQContentBody>(content.getData())); frame.setBof(false); diff --git a/cpp/src/qpid/client/ExecutionHandler.h b/cpp/src/qpid/client/ExecutionHandler.h index 6286ccd591..5e3e75b801 100644 --- a/cpp/src/qpid/client/ExecutionHandler.h +++ b/cpp/src/qpid/client/ExecutionHandler.h @@ -72,7 +72,7 @@ public: // Allow other classes to set the out handler. framing::FrameHandler::Chain out; - ExecutionHandler(uint64_t maxFrameSize = 65536); + ExecutionHandler(uint64_t maxFrameSize = 65535); // Incoming handler. void handle(framing::AMQFrame& frame); diff --git a/cpp/src/qpid/framing/SendContent.cpp b/cpp/src/qpid/framing/SendContent.cpp index 85b9b995ad..a62e4eeb72 100644 --- a/cpp/src/qpid/framing/SendContent.cpp +++ b/cpp/src/qpid/framing/SendContent.cpp @@ -30,7 +30,9 @@ void qpid::framing::SendContent::operator()(const AMQFrame& f) bool first = frameCount == 0; bool last = ++frameCount == expectedFrameCount; - uint16_t maxContentSize = maxFrameSize - AMQFrame::frameOverhead(); + /*end of frame marker is included in frameOverhead() but not in + real frame size, hence substract -1 from frameOverhead()*/ + uint16_t maxContentSize = maxFrameSize - (AMQFrame::frameOverhead() - 1); const AMQContentBody* body(f.castBody<AMQContentBody>()); if (body->size() > maxContentSize) { uint32_t offset = 0; |