diff options
author | Gordon Sim <gsim@apache.org> | 2010-05-27 18:09:13 +0000 |
---|---|---|
committer | Gordon Sim <gsim@apache.org> | 2010-05-27 18:09:13 +0000 |
commit | c95b2615abf0883f7d92aad73138a4dda14e1311 (patch) | |
tree | 7eb2195eab5c7ecafab17e553635a434b20dee64 /cpp/src/qpid/cluster/UpdateClient.cpp | |
parent | 91491e533896be58438ba2dc0e199461b4320653 (diff) | |
download | qpid-python-c95b2615abf0883f7d92aad73138a4dda14e1311.tar.gz |
QPID-2631: For blocking Bounds::expand() calls, only increase the current count when there is space. In SessionImpl::send() expand bounds before queueing frame. Expand bounds for all frames sent (including connection frames and cluster specific frames).
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@948936 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/cluster/UpdateClient.cpp')
-rw-r--r-- | cpp/src/qpid/cluster/UpdateClient.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/cpp/src/qpid/cluster/UpdateClient.cpp b/cpp/src/qpid/cluster/UpdateClient.cpp index 1b740158a4..6499519187 100644 --- a/cpp/src/qpid/cluster/UpdateClient.cpp +++ b/cpp/src/qpid/cluster/UpdateClient.cpp @@ -73,11 +73,22 @@ using namespace framing; namespace arg=client::arg; using client::SessionBase_0_10Access; -struct ClusterConnectionProxy : public AMQP_AllProxy::ClusterConnection { +struct ClusterConnectionProxy : public AMQP_AllProxy::ClusterConnection, public framing::FrameHandler +{ + boost::shared_ptr<qpid::client::ConnectionImpl> connection; + ClusterConnectionProxy(client::Connection c) : - AMQP_AllProxy::ClusterConnection(*client::ConnectionAccess::getImpl(c)) {} + AMQP_AllProxy::ClusterConnection(*static_cast<framing::FrameHandler*>(this)), + connection(client::ConnectionAccess::getImpl(c)) {} ClusterConnectionProxy(client::AsyncSession s) : AMQP_AllProxy::ClusterConnection(SessionBase_0_10Access(s).get()->out) {} + + void handle(framing::AMQFrame& f) + { + assert(connection); + connection->expand(f.encodedSize(), false); + connection->handle(f); + } }; // Create a connection with special version that marks it as a catch-up connection. @@ -153,6 +164,7 @@ void UpdateClient::update() { ClusterConnectionMembershipBody membership; map.toMethodBody(membership); AMQFrame frame(membership); + client::ConnectionAccess::getImpl(connection)->expand(frame.encodedSize(), false); client::ConnectionAccess::getImpl(connection)->handle(frame); connection.close(); |