diff options
author | John DeTreville <jdetreville@vmware.com> | 2010-12-14 16:16:01 -0800 |
---|---|---|
committer | John DeTreville <jdetreville@vmware.com> | 2010-12-14 16:16:01 -0800 |
commit | d6d7b3bee95eee4137b041a3346b22988272b99e (patch) | |
tree | 7fd3ec8045e59c02773c2aa1ebb58694c9b670d2 | |
parent | 63f41f09a6d700d4e1714a96a074fb9f71091deb (diff) | |
download | rabbitmq-server-d6d7b3bee95eee4137b041a3346b22988272b99e.tar.gz |
Put in Matthias's changes.
-rw-r--r-- | ebin/rabbit_app.in | 1 | ||||
-rw-r--r-- | src/rabbit_reader.erl | 20 |
2 files changed, 10 insertions, 11 deletions
diff --git a/ebin/rabbit_app.in b/ebin/rabbit_app.in index 6c33ef8b..d3808a54 100644 --- a/ebin/rabbit_app.in +++ b/ebin/rabbit_app.in @@ -19,6 +19,7 @@ {vm_memory_high_watermark, 0.4}, {msg_store_index_module, rabbit_msg_store_ets_index}, {backing_queue_module, rabbit_variable_queue}, + {frame_max, 131072}, {persister_max_wrap_entries, 500}, {persister_hibernate_after, 10000}, {msg_store_file_size_limit, 16777216}, diff --git a/src/rabbit_reader.erl b/src/rabbit_reader.erl index b6df9c98..cdb3586a 100644 --- a/src/rabbit_reader.erl +++ b/src/rabbit_reader.erl @@ -738,7 +738,7 @@ handle_method0(#'connection.start_ok'{mechanism = Mechanism, sock = Sock}) -> User = rabbit_access_control:check_login(Mechanism, Response), Tune = #'connection.tune'{channel_max = 0, - frame_max = my_frame_max(), + frame_max = server_frame_max(), heartbeat = 0}, ok = send_on_channel0(Sock, Tune, Protocol), State#v1{connection_state = tuning, @@ -751,15 +751,15 @@ handle_method0(#'connection.tune_ok'{frame_max = FrameMax, connection = Connection, sock = Sock, start_heartbeat_fun = SHF}) -> - MyFrameMax = my_frame_max(), + ServerFrameMax = server_frame_max(), if FrameMax /= 0 andalso FrameMax < ?FRAME_MIN_SIZE -> rabbit_misc:protocol_error( not_allowed, "frame_max=~w < ~w min size", [FrameMax, ?FRAME_MIN_SIZE]); - MyFrameMax /= 0 andalso FrameMax > MyFrameMax -> + ServerFrameMax /= 0 andalso FrameMax > ServerFrameMax -> rabbit_misc:protocol_error( not_allowed, "frame_max=~w > ~w max size", - [FrameMax, MyFrameMax]); + [FrameMax, ServerFrameMax]); true -> SendFun = fun() -> @@ -824,13 +824,11 @@ handle_method0(_Method, #v1{connection_state = S}) -> rabbit_misc:protocol_error( channel_error, "unexpected method in connection state ~w", [S]). -%% Compute frame_max for this instance. Could use 0, but breaks QPid Java -%% client. Default is 131072, but user can override in rabbitmq.config. -my_frame_max() -> - case application:get_env(rabbit, frame_max) of - {ok, FM} -> FM; - _ -> 131072 - end. +%% Compute frame_max for this instance. Could simply use 0, but breaks +%% QPid Java client. +server_frame_max() -> + {ok, FrameMax} = application:get_env(rabbit, frame_max), + FrameMax. send_on_channel0(Sock, Method, Protocol) -> ok = rabbit_writer:internal_send_command(Sock, 0, Method, Protocol). |