Skip to content

Commit

Permalink
Reason is optional
Browse files Browse the repository at this point in the history
  • Loading branch information
sms10086 authored and Sean-Der committed Aug 16, 2024
1 parent 13319e0 commit 995637f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion goodbye.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,11 @@ func (g *Goodbye) Header() Header {
// MarshalSize returns the size of the packet once marshaled
func (g *Goodbye) MarshalSize() int {
srcsLength := len(g.Sources) * ssrcLength
reasonLength := len(g.Reason) + 1
// reason is optional
reasonLength := len(g.Reason)
if reasonLength > 0 {
reasonLength++
}

l := headerLength + srcsLength + reasonLength

Expand Down

0 comments on commit 995637f

Please sign in to comment.