summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Bridgen <mikeb@rabbitmq.com>2010-08-02 12:03:23 +0100
committerMichael Bridgen <mikeb@rabbitmq.com>2010-08-02 12:03:23 +0100
commit2efd9f8a2a2b167b21fc22b427613564b0bf6807 (patch)
tree8829767e68f1d5e5c0d249390015778feae7e9ab /src
parent2d6d7e7a9f8b70c71306ce6b5b86006d71a28910 (diff)
parente759510a5dcfa87b213609c4075a34e2664953bc (diff)
downloadrabbitmq-server-git-2efd9f8a2a2b167b21fc22b427613564b0bf6807.tar.gz
Merge 0-8 protocol header fix (bug23040)
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_reader.erl11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/rabbit_reader.erl b/src/rabbit_reader.erl
index 9603faf5a4..a8b2ae5414 100644
--- a/src/rabbit_reader.erl
+++ b/src/rabbit_reader.erl
@@ -562,13 +562,22 @@ handle_input({frame_payload, Type, Channel, PayloadSize}, PayloadAndMarker, Stat
handle_input(handshake, <<"AMQP", 0, 0, 9, 1>>, State) ->
start_connection({0, 9, 1}, rabbit_framing_amqp_0_9_1, State);
+%% This is the protocol header for 0-9, which we can safely treat as
+%% though it were 0-9-1.
handle_input(handshake, <<"AMQP", 1, 1, 0, 9>>, State) ->
start_connection({0, 9, 0}, rabbit_framing_amqp_0_9_1, State);
-%% the 0-8 spec, confusingly, defines the version as 8-0
+%% This is what most clients send for 0-8. The 0-8 spec, confusingly,
+%% defines the version as 8-0.
handle_input(handshake, <<"AMQP", 1, 1, 8, 0>>, State) ->
start_connection({8, 0, 0}, rabbit_framing_amqp_0_8, State);
+%% The 0-8 spec as on the AMQP web site actually has this as the
+%% protocol header; some libraries e.g., py-amqplib, send it when they
+%% want 0-8.
+handle_input(handshake, <<"AMQP", 1, 1, 9, 1>>, State) ->
+ start_connection({8, 0, 0}, rabbit_framing_amqp_0_8, State);
+
handle_input(handshake, <<"AMQP", A, B, C, D>>, #v1{sock = Sock}) ->
refuse_connection(Sock, {bad_version, A, B, C, D});