diff options
| author | Robert Greig <rgreig@apache.org> | 2007-01-25 17:03:28 +0000 |
|---|---|---|
| committer | Robert Greig <rgreig@apache.org> | 2007-01-25 17:03:28 +0000 |
| commit | 96296840180eefa351681653690a8c93a044d2b7 (patch) | |
| tree | 1b31c42f9276c4e2547307e27bb7d5c15bb825fc /java/broker | |
| parent | 8a0f93bf04d6460dc79373372f82e57e08a0d264 (diff) | |
| download | qpid-python-96296840180eefa351681653690a8c93a044d2b7.tar.gz | |
QPID-318 : Patch supplied by Rob Godfrey - remove hard-coding of protocol values
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@499851 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/broker')
3 files changed, 6 insertions, 21 deletions
diff --git a/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQPFastProtocolHandler.java b/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQPFastProtocolHandler.java index 474714680b..dd56fe87ec 100644 --- a/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQPFastProtocolHandler.java +++ b/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQPFastProtocolHandler.java @@ -162,7 +162,8 @@ public class AMQPFastProtocolHandler extends IoHandlerAdapter implements Protoco // TODO: Connect this to the session version obtained from ProtocolInitiation for this session. // Be aware of possible changes to parameter order as versions change. protocolSession.write(ConnectionCloseBody.createAMQFrame(0, - (byte)8, (byte)0, // AMQP version (major, minor) + session.getProtocolMajorVersion(), + session.getProtocolMinorVersion(), // AMQP version (major, minor) 0, // classId 0, // methodId 200, // replyCode diff --git a/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBean.java b/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBean.java index b5fec39626..0b21d26d32 100644 --- a/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBean.java +++ b/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBean.java @@ -206,7 +206,8 @@ public class AMQProtocolSessionMBean extends AMQManagedObject implements Managed // TODO: Connect this to the session version obtained from ProtocolInitiation for this session. // Be aware of possible changes to parameter order as versions change. final AMQFrame response = ConnectionCloseBody.createAMQFrame(0, - (byte)8, (byte)0, // AMQP version (major, minor) + _session.getProtocolMajorVersion(), + _session.getProtocolMinorVersion(), // AMQP version (major, minor) 0, // classId 0, // methodId AMQConstant.REPLY_SUCCESS.getCode(), // replyCode diff --git a/java/broker/src/main/java/org/apache/qpid/server/queue/SubscriptionImpl.java b/java/broker/src/main/java/org/apache/qpid/server/queue/SubscriptionImpl.java index e120752959..181f41fbec 100644 --- a/java/broker/src/main/java/org/apache/qpid/server/queue/SubscriptionImpl.java +++ b/java/broker/src/main/java/org/apache/qpid/server/queue/SubscriptionImpl.java @@ -399,7 +399,8 @@ public class SubscriptionImpl implements Subscription // TODO: Connect this to the session version obtained from ProtocolInitiation for this session. // Be aware of possible changes to parameter order as versions change. protocolSession.writeFrame(BasicCancelOkBody.createAMQFrame(channel.getChannelId(), - (byte)8, (byte)0, // AMQP version (major, minor) + protocolSession.getProtocolMajorVersion(), + protocolSession.getProtocolMinorVersion(), consumerTag // consumerTag )); _closed = true; @@ -417,22 +418,4 @@ public class SubscriptionImpl implements Subscription } - private ByteBuffer createEncodedDeliverFrame(long deliveryTag, AMQShortString routingKey, AMQShortString exchange) - { - // AMQP version change: Hardwire the version to 0-8 (major=8, minor=0) - // TODO: Connect this to the session version obtained from ProtocolInitiation for this session. - // Be aware of possible changes to parameter order as versions change. - AMQFrame deliverFrame = BasicDeliverBody.createAMQFrame(channel.getChannelId(), - (byte)8, (byte)0, // AMQP version (major, minor) - consumerTag, // consumerTag - deliveryTag, // deliveryTag - exchange, // exchange - false, // redelivered - routingKey // routingKey - ); - ByteBuffer buf = ByteBuffer.allocate((int) deliverFrame.getSize()); // XXX: Could cast be a problem? - deliverFrame.writePayload(buf); - buf.flip(); - return buf; - } } |
