From 0efcf2c5c91f4927ccc00ad1cf391c2f964cc2e1 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Wed, 27 Jun 2007 21:19:14 +0000 Subject: * src/qpid/framing/ChannelAdapter.cpp: Use handler chains for in and outbound frames. * src/qpid/framing/InputHandler.h, OutputHandler.h, FrameHandler.h: All handlers pass AMQFrame& and have consistent memory management. Terminal OutputHandlers used to take ownership and delete frame, now they make a shallow copy instead. * src/qpid/framing/Handler.h, FrameHandler.h: Simplified. * src/qpid/client/ClientConnection.cpp: * src/qpid/broker/Connection.cpp: * src/qpid/broker/BrokerChannel.cpp: Update for ChannelAdapter changes. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@551336 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/broker/BrokerChannel.cpp | 3 ++- cpp/src/qpid/broker/Connection.cpp | 4 ++-- cpp/src/qpid/broker/Connection.h | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) (limited to 'cpp/src/qpid/broker') diff --git a/cpp/src/qpid/broker/BrokerChannel.cpp b/cpp/src/qpid/broker/BrokerChannel.cpp index c1f0b44ed4..26e590f87e 100644 --- a/cpp/src/qpid/broker/BrokerChannel.cpp +++ b/cpp/src/qpid/broker/BrokerChannel.cpp @@ -55,7 +55,7 @@ Channel::Channel( uint32_t _framesize, MessageStore* const _store, uint64_t _stagingThreshold ) : - ChannelAdapter(id, &con.getOutput(), con.getVersion()), + ChannelAdapter(), connection(con), currentDeliveryTag(1), prefetchSize(0), @@ -70,6 +70,7 @@ Channel::Channel( flowActive(true), adapter(new BrokerAdapter(*this, con, con.broker)) { + init(id, con.getOutput(), con.getVersion()); outstanding.reset(); } diff --git a/cpp/src/qpid/broker/Connection.cpp b/cpp/src/qpid/broker/Connection.cpp index d809ef14d9..2bd835e753 100644 --- a/cpp/src/qpid/broker/Connection.cpp +++ b/cpp/src/qpid/broker/Connection.cpp @@ -66,8 +66,8 @@ Exchange::shared_ptr Connection::findExchange(const string& name){ } -void Connection::received(framing::AMQFrame* frame){ - getChannel(frame->getChannel()).handleBody(frame->getBody()); +void Connection::received(framing::AMQFrame& frame){ + getChannel((frame.getChannel())).getHandlers().in->handle(frame); } void Connection::close( diff --git a/cpp/src/qpid/broker/Connection.h b/cpp/src/qpid/broker/Connection.h index 3fc575280a..fcfc1d3334 100644 --- a/cpp/src/qpid/broker/Connection.h +++ b/cpp/src/qpid/broker/Connection.h @@ -80,7 +80,7 @@ class Connection : public sys::ConnectionInputHandler, std::vector exclusiveQueues; // ConnectionInputHandler methods - void received(framing::AMQFrame* frame); + void received(framing::AMQFrame& frame); void initiated(const framing::ProtocolInitiation& header); void idleOut(); void idleIn(); -- cgit v1.2.1