summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2010-06-24 13:36:42 +0100
committerSimon MacMullen <simon@rabbitmq.com>2010-06-24 13:36:42 +0100
commitc66e8d1f66a0bdbba4a5584d62cd98eb6837b642 (patch)
tree91328861aac725ba2ecf1f495b8df239b56db3cd
parent96a1984b44dbd71cfd0191d1e4dcca7f84d197a7 (diff)
downloadrabbitmq-server-c66e8d1f66a0bdbba4a5584d62cd98eb6837b642.tar.gz
Don't pull protocol version from the JSON.
-rw-r--r--codegen.py2
-rw-r--r--include/rabbit.hrl1
-rw-r--r--src/rabbit.erl4
-rw-r--r--src/rabbit_reader.erl10
4 files changed, 7 insertions, 10 deletions
diff --git a/codegen.py b/codegen.py
index 0d6d9d56..467b0285 100644
--- a/codegen.py
+++ b/codegen.py
@@ -410,8 +410,6 @@ def genHrl(spec):
methods = spec.allMethods()
printFileHeader()
- print "-define(PROTOCOL_VERSION_MAJOR, %d)." % (spec.major)
- print "-define(PROTOCOL_VERSION_MINOR, %d)." % (spec.minor)
print "-define(PROTOCOL_PORT, %d)." % (spec.port)
for (c,v,cls) in spec.constants:
diff --git a/include/rabbit.hrl b/include/rabbit.hrl
index cff17e08..7e6ba8fc 100644
--- a/include/rabbit.hrl
+++ b/include/rabbit.hrl
@@ -181,6 +181,7 @@
-define(COPYRIGHT_MESSAGE, "Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial Technologies LLC., and Rabbit Technologies Ltd.").
-define(INFORMATION_MESSAGE, "Licensed under the MPL. See http://www.rabbitmq.com/").
+-define(PROTOCOL_VERSION, "AMQP 0-8").
-define(ERTS_MINIMUM, "5.6.3").
-define(MAX_WAIT, 16#ffffffff).
diff --git a/src/rabbit.erl b/src/rabbit.erl
index 6cf6d7d5..7df39987 100644
--- a/src/rabbit.erl
+++ b/src/rabbit.erl
@@ -424,9 +424,9 @@ print_banner() ->
"| ~s +---+ |~n"
"| |~n"
"+-------------------+~n"
- "AMQP ~p-~p~n~s~n~s~n~n",
+ "~s~n~s~n~s~n~n",
[Product, string:right([$v|Version], ProductLen),
- ?PROTOCOL_VERSION_MAJOR, ?PROTOCOL_VERSION_MINOR,
+ ?PROTOCOL_VERSION,
?COPYRIGHT_MESSAGE, ?INFORMATION_MESSAGE]),
Settings = [{"node", node()},
{"app descriptor", app_location()},
diff --git a/src/rabbit_reader.erl b/src/rabbit_reader.erl
index 73884d99..98b4d647 100644
--- a/src/rabbit_reader.erl
+++ b/src/rabbit_reader.erl
@@ -547,14 +547,14 @@ handle_input({frame_payload, Type, Channel, PayloadSize}, PayloadAndMarker, Stat
handle_input(handshake, <<"AMQP",1,1,ProtocolMajor,ProtocolMinor>>,
State = #v1{sock = Sock, connection = Connection}) ->
case check_version({ProtocolMajor, ProtocolMinor},
- {?PROTOCOL_VERSION_MAJOR, ?PROTOCOL_VERSION_MINOR}) of
+ {0, 8}) of
true ->
Protocol = amqp_0_8,
ok = send_on_channel0(
Sock,
#'connection.start'{
- version_major = ?PROTOCOL_VERSION_MAJOR,
- version_minor = ?PROTOCOL_VERSION_MINOR,
+ version_major = 0,
+ version_minor = 8,
server_properties = server_properties(),
mechanisms = <<"PLAIN AMQPLAIN">>,
locales = <<"en_US">> },
@@ -570,9 +570,7 @@ handle_input(handshake, <<"AMQP",1,1,ProtocolMajor,ProtocolMinor>>,
handle_input(handshake, Other, #v1{sock = Sock}) ->
ok = inet_op(fun () -> rabbit_net:send(
- Sock, <<"AMQP",1,1,
- ?PROTOCOL_VERSION_MAJOR,
- ?PROTOCOL_VERSION_MINOR>>) end),
+ Sock, <<"AMQP",1,1,0,8>>) end),
throw({bad_header, Other});
handle_input(Callback, Data, _State) ->