Skip to content

Commit

Permalink
fix wrong unsubscribe code handling
Browse files Browse the repository at this point in the history
  • Loading branch information
FZambia committed Jan 5, 2023
1 parent a013082 commit abff7c6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions subscription.go
Original file line number Diff line number Diff line change
Expand Up @@ -617,10 +617,10 @@ func (s *Subscription) handleLeave(info *protocol.ClientInfo) {

func (s *Subscription) handleUnsubscribe(unsubscribe *protocol.Unsubscribe) {
if unsubscribe.Code < 2500 {
s.moveToSubscribing(unsubscribe.Code, "server")
s.resubscribe()
s.moveToUnsubscribed(unsubscribe.Code, unsubscribe.Reason)
} else {
s.moveToUnsubscribed(unsubscribe.Code, "server")
s.moveToSubscribing(unsubscribe.Code, unsubscribe.Reason)
s.resubscribe()
}
}

Expand Down

0 comments on commit abff7c6

Please sign in to comment.