Skip to content

Commit 1244829

Browse files
author
Simon MacMullen
committed
Make the wrong-protocol error message make slightly more sense.
1 parent 718a9d3 commit 1244829

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/com/rabbitmq/client/impl/Frame.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,13 @@ public static void protocolVersionMismatch(DataInputStream is) throws IOExceptio
177177
int transportLow = is.readUnsignedByte();
178178
int serverMajor = is.readUnsignedByte();
179179
int serverMinor = is.readUnsignedByte();
180+
181+
// 0-8 gets these the wrong way round
182+
if (serverMajor == 8 && serverMinor == 0) {
183+
serverMajor = 0;
184+
serverMinor = 8;
185+
}
186+
180187
x = new MalformedFrameException("AMQP protocol version mismatch; we are version " + AMQP.PROTOCOL.MAJOR + "-" + AMQP.PROTOCOL.MINOR
181188
+ ", server is " + serverMajor + "-" + serverMinor + " with transport " + transportHigh + "." + transportLow);
182189
} catch (IOException ex) {

0 commit comments

Comments
 (0)