summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Radestock <matthias@rabbitmq.com>2012-07-17 11:26:03 +0100
committerMatthias Radestock <matthias@rabbitmq.com>2012-07-17 11:26:03 +0100
commitb20e65292c966802b9d27df6c239731c7573b638 (patch)
tree7824b6592da19d2fd5985b9410c843a977f8898b
parent2a80717d4ef07eb1c137aeed911217040858aae5 (diff)
downloadrabbitmq-server-b20e65292c966802b9d27df6c239731c7573b638.tar.gz
allow clients to exceed frame size by a little bit
-rw-r--r--src/rabbit_reader.erl7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/rabbit_reader.erl b/src/rabbit_reader.erl
index ee9b22c2..477961ae 100644
--- a/src/rabbit_reader.erl
+++ b/src/rabbit_reader.erl
@@ -589,9 +589,14 @@ post_process_frame(_Frame, _ChPid, State) ->
%%--------------------------------------------------------------------------
+%% We allow clients to exceed the frame size a little bit since quite
+%% a few get it wrong - off-by 1 or 8 (empty frame size) are typical.
+-define(FRAME_SIZE_FUDGE, ?EMPTY_FRAME_SIZE).
+
handle_input(frame_header, <<Type:8,Channel:16,PayloadSize:32>>,
#v1{connection = #connection{frame_max = FrameMax}})
- when FrameMax /= 0 andalso PayloadSize > FrameMax - ?EMPTY_FRAME_SIZE ->
+ when FrameMax /= 0 andalso
+ PayloadSize > FrameMax - ?EMPTY_FRAME_SIZE + ?FRAME_SIZE_FUDGE ->
throw({frame_too_large, Type, Channel, PayloadSize,
FrameMax - ?EMPTY_FRAME_SIZE});
handle_input(frame_header, <<Type:8,Channel:16,PayloadSize:32>>, State) ->