Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 33 additions & 8 deletions deps/rabbitmq_stream/src/rabbit_stream_reader.erl
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,10 @@ tcp_connected(info, Msg, StateData) ->
?FUNCTION_NAME,
NextConnectionStep)
end
end).
end);
tcp_connected({call, From}, {info, _Items}, _StateData) ->
%% must be a CLI call, not ready for this
{keep_state_and_data, {reply, From, []}}.

peer_properties_exchanged(enter, _OldState,
#statem_data{config =
Expand Down Expand Up @@ -282,7 +285,10 @@ peer_properties_exchanged(info, Msg, StateData) ->
?FUNCTION_NAME,
NextConnectionStep)
end
end).
end);
peer_properties_exchanged({call, From}, {info, _Items}, _StateData) ->
%% must be a CLI call, not ready for this
{keep_state_and_data, {reply, From, []}}.

authenticating(enter, _OldState,
#statem_data{config =
Expand Down Expand Up @@ -323,7 +329,10 @@ authenticating(info, Msg, StateData) ->
?FUNCTION_NAME,
NextConnectionStep)
end
end).
end);
authenticating({call, From}, {info, _Items}, _StateData) ->
%% must be a CLI call, not ready for this
{keep_state_and_data, {reply, From, []}}.

tuning(enter, _OldState,
#statem_data{config =
Expand Down Expand Up @@ -360,7 +369,10 @@ tuning(info, Msg, StateData) ->
?FUNCTION_NAME,
NextConnectionStep)
end
end).
end);
tuning({call, From}, {info, _Items}, _StateData) ->
%% must be a CLI call, not ready for this
{keep_state_and_data, {reply, From, []}}.

tuned(enter, _OldState,
#statem_data{config =
Expand Down Expand Up @@ -390,7 +402,10 @@ tuned(info, Msg, StateData) ->
?FUNCTION_NAME,
NextConnectionStep)
end
end).
end);
tuned({call, From}, {info, _Items}, _StateData) ->
%% must be a CLI call, not ready for this
{keep_state_and_data, {reply, From, []}}.

state_timeout(State, Transport, Socket) ->
rabbit_log_connection:warning("Closing connection because of timeout in state "
Expand Down Expand Up @@ -1185,7 +1200,11 @@ close_sent(info, {resource_alarm, IsThereAlarm},
close_sent(info, Msg, _StatemData) ->
rabbit_log_connection:warning("Ignored unknown message ~tp in state ~ts",
[Msg, ?FUNCTION_NAME]),
keep_state_and_data.
keep_state_and_data;
close_sent({call, From}, {info, _Items}, _StateData) ->
%% must be a CLI call, returning no information
{keep_state_and_data, {reply, From, []}}.


handle_inbound_data_pre_auth(Transport, Connection, State, Data) ->
handle_inbound_data(Transport,
Expand Down Expand Up @@ -3761,8 +3780,14 @@ ensure_stats_timer(Connection = #stream_connection{}) ->
rabbit_event:ensure_stats_timer(Connection,
#stream_connection.stats_timer, emit_stats).

in_vhost(_Pid, undefined) ->
true;
in_vhost(Pid, undefined) ->
%% no vhost filter, but check the connection is in open state and can return information
case info(Pid, [vhost]) of
[{vhost, _}] ->
true;
_ ->
false
end;
in_vhost(Pid, VHost) ->
case info(Pid, [vhost]) of
[{vhost, VHost}] ->
Expand Down
Loading