Skip to content

Commit 1031271

Browse files
committed
fixup! max_frame_length -> max_frame_size
1 parent 75cec6f commit 1031271

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

deps/rabbitmq_stomp/src/rabbit_stomp_reader.erl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
timeout]).
2626

2727
-record(reader_state, {socket, conn_name, parse_state, processor_state, state,
28-
conserve_resources, recv_outstanding, max_frame_length, frame_length,
28+
conserve_resources, recv_outstanding, max_frame_size, frame_length,
2929
stats_timer, parent, connection, heartbeat_sup, heartbeat,
3030
timeout_sec %% heartbeat timeout value used, 0 means
3131
%% heartbeats are disabled
@@ -69,7 +69,7 @@ init([SupHelperPid, Ref, Configuration]) ->
6969
_ = register_resource_alarm(),
7070

7171
LoginTimeout = application:get_env(rabbitmq_stomp, login_timeout, 10_000),
72-
MaxFrameLength = application:get_env(rabbitmq_stomp, max_frame_length, 192 * 1024),
72+
MaxFrameSize = application:get_env(rabbitmq_stomp, max_frame_size, 192 * 1024),
7373
erlang:send_after(LoginTimeout, self(), login_timeout),
7474

7575
gen_server2:enter_loop(?MODULE, [],
@@ -81,7 +81,7 @@ init([SupHelperPid, Ref, Configuration]) ->
8181
processor_state = ProcState,
8282
heartbeat_sup = SupHelperPid,
8383
heartbeat = {none, none},
84-
max_frame_length = MaxFrameLength,
84+
max_frame_size = MaxFrameSize,
8585
frame_length = 0,
8686
state = running,
8787
conserve_resources = false,
@@ -225,26 +225,26 @@ process_received_bytes([], State) ->
225225
{ok, State};
226226
process_received_bytes(Bytes,
227227
State = #reader_state{
228-
max_frame_length = MaxFrameLength,
228+
max_frame_size = MaxFrameSize,
229229
frame_length = FrameLength,
230230
processor_state = ProcState,
231231
parse_state = ParseState}) ->
232232
case rabbit_stomp_frame:parse(Bytes, ParseState) of
233233
{more, ParseState1} ->
234234
FrameLength1 = FrameLength + byte_size(Bytes),
235-
case FrameLength1 > MaxFrameLength of
235+
case FrameLength1 > MaxFrameSize of
236236
true ->
237-
log_reason({network_error, {frame_too_big, {FrameLength1, MaxFrameLength}}}, State),
237+
log_reason({network_error, {frame_too_big, {FrameLength1, MaxFrameSize}}}, State),
238238
{stop, normal, State};
239239
false ->
240240
{ok, State#reader_state{parse_state = ParseState1,
241241
frame_length = FrameLength1}}
242242
end;
243243
{ok, Frame, Rest} ->
244244
FrameLength1 = FrameLength + byte_size(Bytes) - byte_size(Rest),
245-
case FrameLength1 > MaxFrameLength of
245+
case FrameLength1 > MaxFrameSize of
246246
true ->
247-
log_reason({network_error, {frame_too_big, {FrameLength1, MaxFrameLength}}}, State),
247+
log_reason({network_error, {frame_too_big, {FrameLength1, MaxFrameSize}}}, State),
248248
{stop, normal, State};
249249
false ->
250250
case rabbit_stomp_processor:process_frame(Frame, ProcState) of

deps/rabbitmq_stomp/test/connections_SUITE.erl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ login_timeout(Config) ->
180180
frame_size(Config) ->
181181
rabbit_ct_broker_helpers:rpc(
182182
Config, 0,
183-
application, set_env, [rabbitmq_stomp, max_frame_length, 80]),
183+
application, set_env, [rabbitmq_stomp, max_frame_size, 80]),
184184
StompPort = get_stomp_port(Config),
185185
{ok, Client} = rabbit_stomp_client:connect("1.2", "guest", "guest", StompPort,
186186
[{"heart-beat", "5000,7000"}]),
@@ -199,7 +199,7 @@ frame_size(Config) ->
199199
frame_size_huge(Config) ->
200200
rabbit_ct_broker_helpers:rpc(
201201
Config, 0,
202-
application, set_env, [rabbitmq_stomp, max_frame_length, 700]),
202+
application, set_env, [rabbitmq_stomp, max_frame_size, 700]),
203203
StompPort = get_stomp_port(Config),
204204
{ok, Client} = rabbit_stomp_client:connect("1.2", "guest", "guest", StompPort,
205205
[{"heart-beat", "5000,7000"}]),

deps/rabbitmq_stomp/test/python_SUITE.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ end_per_testcase(Test, Config) ->
6767
main(Config) ->
6868
rabbit_ct_broker_helpers:rpc(
6969
Config, 0,
70-
application, set_env, [rabbitmq_stomp, max_frame_length, 17 * 1024 * 1024]),
70+
application, set_env, [rabbitmq_stomp, max_frame_size, 17 * 1024 * 1024]),
7171
run(Config, filename:join("src", "main_runner.py")).
7272

7373
implicit_connect(Config) ->

0 commit comments

Comments
 (0)