Skip to content

Commit

Permalink
don't break line limit with client init
Browse files Browse the repository at this point in the history
  • Loading branch information
kickster97 committed Jan 21, 2025
1 parent c14e65b commit 8cf1321
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion src/lavinmq/mqtt/broker.cr
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,14 @@ module LavinMQ
if prev_client = @clients[packet.client_id]?
prev_client.close("New client #{connection_info.src} (username=#{packet.username}) connected as #{packet.client_id}")
end
client = MQTT::Client.new(socket, connection_info, user, self, packet.client_id, packet.clean_session?, packet.keepalive, packet.will)
client = MQTT::Client.new(socket,
connection_info,
user,
self,
packet.client_id,
packet.clean_session?,
packet.keepalive,
packet.will)
if session = sessions[client.client_id]?
if client.clean_session?
sessions.delete session
Expand Down
2 changes: 1 addition & 1 deletion src/lavinmq/mqtt/client.cr
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ module LavinMQ
@user : User,
@broker : MQTT::Broker,
@client_id : String,
@clean_session = false,
@clean_session : Bool = false,
@keepalive : UInt16 = 30,
@will : MQTT::Will? = nil)
@io = MQTT::IO.new(@socket)
Expand Down

0 comments on commit 8cf1321

Please sign in to comment.