Skip to content

Commit

Permalink
fixups
Browse files Browse the repository at this point in the history
  • Loading branch information
carlhoerberg committed Feb 19, 2024
1 parent ffad214 commit 67dff54
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/amqproxy/client.cr
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ require "./records"

module AMQProxy
class Client
Log = ::Log.for(self)
getter credentials : Credentials
@channel_map = Hash(UInt16, UpstreamChannel).new
@outgoing_frames = Channel(AMQ::Protocol::Frame).new(128)
Expand Down Expand Up @@ -58,7 +59,7 @@ module AMQProxy
end
end
end
rescue ex : IO::Error | OpenSSL::SSL::Error
rescue ex : IO::Error
raise Error.new("Client disconnected", ex) unless socket.closed?
ensure
@outgoing_frames.close
Expand All @@ -72,7 +73,7 @@ module AMQProxy

break if frame.is_a? AMQ::Protocol::Frame::Connection::CloseOk
end
rescue ex : IO::Error | OpenSSL::SSL::Error
rescue ex : IO::Error
raise ex unless socket.closed?
ensure
@outgoing_frames.close
Expand Down
1 change: 1 addition & 0 deletions src/amqproxy/upstream.cr
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ module AMQProxy
end

private def close_all_client_channels
Log.debug { "Closing all client channels for closed upstream" }
@channels_lock.synchronize do
@channels.each_value do |downstream_channel|
downstream_channel.try &.close
Expand Down

0 comments on commit 67dff54

Please sign in to comment.