Skip to content

Commit

Permalink
rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
kickster97 committed Jan 23, 2025
1 parent a93cbc3 commit 0161b46
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/lavinmq/amqp/connection_factory.cr
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ module LavinMQ
Log = LavinMQ::Log.for "amqp.connection_factory"

def initialize(@users : UserStore, @vhosts : VHostStore)
@auth_chain = LavinMQ::Auth::Chain.new(@users)
end

def start(socket, connection_info, auth_chain) : Client?
@auth_chain = LavinMQ::Auth::Chain.new(users)
def start(socket, connection_info) : Client?
remote_address = connection_info.src
socket.read_timeout = 15.seconds
metadata = ::Log::Metadata.build({address: remote_address.to_s})
logger = Logger.new(Log, metadata)
if confirm_header(socket, logger)
if start_ok = start(socket, logger)
if user = authenticate(socket, remote_address, start_ok, logger, auth_chain)
if user = authenticate(socket, remote_address, start_ok, logger, @auth_chain)
if tune_ok = tune(socket, logger)
if vhost = open(socket, user, logger)
socket.read_timeout = heartbeat_timeout(tune_ok)
Expand Down
2 changes: 1 addition & 1 deletion src/lavinmq/server.cr
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ module LavinMQ
end

def handle_connection(socket, connection_info)
client = @amqp_connection_factory.start(socket, connection_info, @auth_chain)
client = @amqp_connection_factory.start(socket, connection_info)
ensure
socket.close if client.nil?
end
Expand Down

0 comments on commit 0161b46

Please sign in to comment.