summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKim van der Riet <kpvdr@apache.org>2007-01-04 21:30:39 +0000
committerKim van der Riet <kpvdr@apache.org>2007-01-04 21:30:39 +0000
commit077caff939a3647e7538c309863a012c92f1c767 (patch)
tree0be71c5c4fbf83c289cb7db19e05fce116f25a5b
parent9fae14cc56a6608cce8f398319a76ff8b7cb48be (diff)
downloadqpid-python-077caff939a3647e7538c309863a012c92f1c767.tar.gz
Fixed C++ client sending protocol version 0-0 over the wire. Minor fixes and tidy-up in related code.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@492756 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--cpp/lib/common/Makefile.am3
-rw-r--r--gentools/src/org/apache/qpid/gentools/Main.java2
-rw-r--r--gentools/templ.cpp/AMQP_HighestVersion.cpp.tmpl31
-rw-r--r--gentools/templ.cpp/AMQP_HighestVersion.h.tmpl (renamed from cpp/lib/common/framing/AMQP_HighestVersion.h)11
-rw-r--r--gentools/templ.java/MethodBodyClass.tmpl4
-rw-r--r--java/broker/src/main/java/org/apache/qpid/server/protocol/AMQMinaProtocolSession.java11
-rw-r--r--java/common/src/main/java/org/apache/qpid/framing/ProtocolInitiation.java12
7 files changed, 12 insertions, 62 deletions
diff --git a/cpp/lib/common/Makefile.am b/cpp/lib/common/Makefile.am
index e1f7503282..fe05498b97 100644
--- a/cpp/lib/common/Makefile.am
+++ b/cpp/lib/common/Makefile.am
@@ -72,7 +72,7 @@ libqpidcommon_la_SOURCES = \
$(framing)/ProtocolVersionException.cpp \
$(framing)/Value.cpp \
$(gen)/AMQP_ClientProxy.cpp \
- $(gen)/AMQP_HighestVersion.cpp \
+ $(gen)/AMQP_HighestVersion.h \
$(gen)/AMQP_MethodVersionMap.cpp \
$(gen)/AMQP_ServerProxy.cpp \
Exception.cpp \
@@ -105,7 +105,6 @@ nobase_pkginclude_HEADERS = \
$(framing)/Value.h \
$(framing)/amqp_framing.h \
$(framing)/amqp_types.h \
- $(framing)/AMQP_HighestVersion.h \
Exception.h \
ExceptionHolder.h \
QpidError.h \
diff --git a/gentools/src/org/apache/qpid/gentools/Main.java b/gentools/src/org/apache/qpid/gentools/Main.java
index 39fb6c3c45..189d3eb5ae 100644
--- a/gentools/src/org/apache/qpid/gentools/Main.java
+++ b/gentools/src/org/apache/qpid/gentools/Main.java
@@ -202,7 +202,7 @@ public class Main
new File(tmplDir + Utils.fileSeparator + "AMQP_Constants.h.tmpl"),
new File(tmplDir + Utils.fileSeparator + "AMQP_MethodVersionMap.h.tmpl"),
new File(tmplDir + Utils.fileSeparator + "AMQP_MethodVersionMap.cpp.tmpl"),
- new File(tmplDir + Utils.fileSeparator + "AMQP_HighestVersion.cpp.tmpl")
+ new File(tmplDir + Utils.fileSeparator + "AMQP_HighestVersion.h.tmpl")
};
methodTemplateFiles = new File[]
{
diff --git a/gentools/templ.cpp/AMQP_HighestVersion.cpp.tmpl b/gentools/templ.cpp/AMQP_HighestVersion.cpp.tmpl
deleted file mode 100644
index e82a8d697d..0000000000
--- a/gentools/templ.cpp/AMQP_HighestVersion.cpp.tmpl
+++ /dev/null
@@ -1,31 +0,0 @@
-&{AMQP_HighestVersion.cpp}
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-/*
- * This file is auto-generated by ${GENERATOR} - do not modify.
- * Supported AMQP versions:
-%{VLIST} * ${major}-${minor}
- */
-
-#include <AMQP_HighestVersion.h>
-
-qpid::framing::ProtocolVersion highestProtocolVersion(${hv_latest_major}, ${hv_latest_minor});
diff --git a/cpp/lib/common/framing/AMQP_HighestVersion.h b/gentools/templ.cpp/AMQP_HighestVersion.h.tmpl
index aecf92ca22..96ee9416b0 100644
--- a/cpp/lib/common/framing/AMQP_HighestVersion.h
+++ b/gentools/templ.cpp/AMQP_HighestVersion.h.tmpl
@@ -1,3 +1,4 @@
+&{AMQP_HighestVersion.h}
/*
*
* Licensed to the Apache Software Foundation (ASF) under one
@@ -20,14 +21,10 @@
*/
/*
- * This file is auto-generated by Qpid Gentools v.0.1 - do not modify.
+ * This file is auto-generated by ${GENERATOR} - do not modify.
* Supported AMQP versions:
- * 0-9
- * 0-10
- * 8-0
+%{VLIST} * ${major}-${minor}
*/
-
-
#ifndef _AMQP_HighestVersion_
#define _AMQP_HighestVersion_
@@ -37,7 +34,7 @@
namespace qpid {
namespace framing {
-static ProtocolVersion highestProtocolVersion;
+static ProtocolVersion highestProtocolVersion(${hv_latest_major}, ${hv_latest_minor});
} /* namespace framing */
} /* namespace qpid */
diff --git a/gentools/templ.java/MethodBodyClass.tmpl b/gentools/templ.java/MethodBodyClass.tmpl
index ad1ce36006..04ce639f23 100644
--- a/gentools/templ.java/MethodBodyClass.tmpl
+++ b/gentools/templ.java/MethodBodyClass.tmpl
@@ -84,7 +84,7 @@ ${METHOD_ID_INIT}
return buf.toString();
}
- public static AMQFrame createAMQFrame(int channelId, byte major, byte minor
+ public static AMQFrame createAMQFrame(int _channelId, byte major, byte minor
%{FLIST} ${mb_field_parameter_list}
)
{
@@ -92,7 +92,7 @@ ${METHOD_ID_INIT}
%{FLIST} ${mb_field_body_initialize}
AMQFrame frame = new AMQFrame();
- frame.channel = channelId;
+ frame.channel = _channelId;
frame.bodyFrame = body;
return frame;
}
diff --git a/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQMinaProtocolSession.java b/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQMinaProtocolSession.java
index 9ff6b96690..831117d2c6 100644
--- a/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQMinaProtocolSession.java
+++ b/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQMinaProtocolSession.java
@@ -165,17 +165,14 @@ public class AMQMinaProtocolSession implements AMQProtocolSession,
_minor = pi.protocolMinor;
String mechanisms = ApplicationRegistry.getInstance().getAuthenticationManager().getMechanisms();
String locales = "en_US";
- // 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.
+ // Interfacing with generated code - be aware of possible changes to parameter order as versions change.
AMQFrame response = ConnectionStartBody.createAMQFrame((short) 0,
- (byte)8, (byte)0, // AMQP version (major, minor)
+ _major, _minor, // AMQP version (major, minor)
locales.getBytes(), // locales
mechanisms.getBytes(), // mechanisms
null, // serverProperties
- (short)8, // versionMajor
- (short)0 // versionMinor
- );
+ (short)_major, // versionMajor
+ (short)_minor); // versionMinor
_minaProtocolSession.write(response);
}
catch (AMQException e)
diff --git a/java/common/src/main/java/org/apache/qpid/framing/ProtocolInitiation.java b/java/common/src/main/java/org/apache/qpid/framing/ProtocolInitiation.java
index f0d5489527..f2d1a70cdc 100644
--- a/java/common/src/main/java/org/apache/qpid/framing/ProtocolInitiation.java
+++ b/java/common/src/main/java/org/apache/qpid/framing/ProtocolInitiation.java
@@ -146,18 +146,6 @@ public class ProtocolInitiation extends AMQDataBlock implements EncodableAMQData
throw new AMQProtocolInstanceException("Protocol instance " + CURRENT_PROTOCOL_INSTANCE + " was expected; received " +
protocolInstance);
}
- /*
- if (protocolMajor != CURRENT_PROTOCOL_VERSION_MAJOR)
- {
- throw new AMQProtocolVersionException("Protocol major version " + CURRENT_PROTOCOL_VERSION_MAJOR +
- " was expected; received " + protocolMajor);
- }
- if (protocolMinor != CURRENT_PROTOCOL_VERSION_MINOR)
- {
- throw new AMQProtocolVersionException("Protocol minor version " + CURRENT_PROTOCOL_VERSION_MINOR +
- " was expected; received " + protocolMinor);
- }
- */
/* Look through list of available protocol versions */
boolean found = false;