From 7a4253a0d77a6f7404d2dcb83b1f3b699077c4d0 Mon Sep 17 00:00:00 2001 From: Jakub Witczak Date: Fri, 12 Jun 2026 09:05:10 +0200 Subject: [PATCH] ssh: Use FIFO ordering for global request queue The request queue used prepend (LIFO), causing keepalive responses to be matched to newer channel open requests instead of the original keepalive probe. Switch to append so responses match requests in send order. --- lib/ssh/src/ssh_connection_handler.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ssh/src/ssh_connection_handler.erl b/lib/ssh/src/ssh_connection_handler.erl index f2b5ba4e43a4..c1e0fe600ef6 100644 --- a/lib/ssh/src/ssh_connection_handler.erl +++ b/lib/ssh/src/ssh_connection_handler.erl @@ -1813,12 +1813,12 @@ add_request(false, _ChannelId, _From, State) -> add_request(true, ChannelId, From, #data{connection_state = #connection{requests = Requests0} = Connection} = State) -> - Requests = [{ChannelId, From} | Requests0], + Requests = Requests0 ++ [{ChannelId, From}], State#data{connection_state = Connection#connection{requests = Requests}}; add_request(Fun, ChannelId, From, #data{connection_state = #connection{requests = Requests0} = Connection} = State) when is_function(Fun) -> - Requests = [{ChannelId, From, Fun} | Requests0], + Requests = Requests0 ++ [{ChannelId, From, Fun}], State#data{connection_state = Connection#connection{requests = Requests}}. new_channel_id(#data{connection_state = #connection{channel_id_seed = Id} =