summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Bridgen <mikeb@rabbitmq.com>2010-08-02 12:02:12 +0100
committerMichael Bridgen <mikeb@rabbitmq.com>2010-08-02 12:02:12 +0100
commitcdecea3f168dcb083a22d1fa6d7b447a75f59688 (patch)
tree9411bfb432c4a121255e50fd9590bb4a313a09c2
parente89b9c806bcf671bd2879c76927cf9014e14df2e (diff)
downloadrabbitmq-server-bug23040.tar.gz
The crazy protocol header is the 0-8 spec's fault; adjust comment to not impugn py-amqp's good name (and document other headers)bug23040
-rw-r--r--src/rabbit_reader.erl9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/rabbit_reader.erl b/src/rabbit_reader.erl
index f687f814..a8b2ae54 100644
--- a/src/rabbit_reader.erl
+++ b/src/rabbit_reader.erl
@@ -562,14 +562,19 @@ 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);
-%% py-amqplib has always sent this broken version. It wants 0-8.
+%% 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);