Skip to content

Commit

Permalink
Use ErrServerBusy instead of ErrQuotaExceeded
Browse files Browse the repository at this point in the history
  • Loading branch information
thedevop committed Apr 1, 2024
1 parent b33b68d commit 00898d0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -420,10 +420,10 @@ func (s *Server) attachClient(cl *Client, listener string) error {
if cl.Properties.ProtocolVersion < 5 {
s.SendConnack(cl, packets.ErrServerUnavailable, false, nil)
} else {
s.SendConnack(cl, packets.ErrQuotaExceeded, false, nil)
s.SendConnack(cl, packets.ErrServerBusy, false, nil)
}

return packets.ErrQuotaExceeded
return packets.ErrServerBusy
}

code := s.validateConnect(cl, pk) // [MQTT-3.1.4-1] [MQTT-3.1.4-2]
Expand Down
2 changes: 1 addition & 1 deletion server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -974,7 +974,7 @@ func TestEstablishConnectionMaximumClientsReached(t *testing.T) {

err := <-o
require.Error(t, err)
require.ErrorIs(t, err, packets.ErrQuotaExceeded)
require.ErrorIs(t, err, packets.ErrServerBusy)

_ = r.Close()
}
Expand Down

0 comments on commit 00898d0

Please sign in to comment.