diff options
author | Simon MacMullen <simon@rabbitmq.com> | 2010-06-23 12:22:42 +0100 |
---|---|---|
committer | Simon MacMullen <simon@rabbitmq.com> | 2010-06-23 12:22:42 +0100 |
commit | c07bf3559405a133d17a50659952a9457869ced9 (patch) | |
tree | 6a3e507ef54407d7687cb88395b6b4a0ee8d377e | |
parent | f7e1929492d067a83c5f1eddd06856380e6f0a70 (diff) | |
download | rabbitmq-server-c07bf3559405a133d17a50659952a9457869ced9.tar.gz |
I think this logic finally makes sense.
-rw-r--r-- | src/rabbit_reader.erl | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/rabbit_reader.erl b/src/rabbit_reader.erl index e8198fbf..9d84a270 100644 --- a/src/rabbit_reader.erl +++ b/src/rabbit_reader.erl @@ -54,7 +54,7 @@ -define(CHANNEL_TERMINATION_TIMEOUT, 3). -define(SILENT_CLOSE_DELAY, 3). %% set to zero once QPid fix their negotiation --define(FRAME_MAX, 131072). +-define(FRAME_MAX, 0). -define(CHANNEL_MAX, 0). %--------------------------------------------------------------------------- @@ -620,13 +620,18 @@ handle_method0(#'connection.tune_ok'{channel_max = ChannelMax, State = #v1{connection_state = tuning, connection = Connection, sock = Sock}) -> - if (FrameMax =< ?FRAME_MIN_SIZE) or + if (FrameMax /= 0) and (FrameMax < ?FRAME_MIN_SIZE) -> + rabbit_misc:protocol_error( + not_allowed, "frame_max ~p smaller than ~p", + [FrameMax, ?FRAME_MIN_SIZE]); (?FRAME_MAX /= 0) and (FrameMax > ?FRAME_MAX) -> rabbit_misc:protocol_error( - not_allowed, "invalid frame_max", []); + not_allowed, "frame_max ~p larger than ~p", + [FrameMax, ?FRAME_MAX]); (?CHANNEL_MAX /= 0) and (ChannelMax > ?CHANNEL_MAX) -> rabbit_misc:protocol_error( - not_allowed, "invalid channel_max", []); + not_allowed, "channel_max ~p larger than ~p", + [ChannelMax, ?CHANNEL_MAX]); true -> rabbit_heartbeat:start_heartbeat(Sock, ClientHeartbeat), State#v1{connection_state = opening, |