Skip to content

Commit

Permalink
Update WriteSCTP outbound packet too large error
Browse files Browse the repository at this point in the history
  • Loading branch information
rob-deutsch committed Mar 14, 2024
1 parent 80ec14e commit 6c3ef3a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"errors"
"fmt"
"io"
"math"
"os"
"sync"
"sync/atomic"
Expand Down Expand Up @@ -266,7 +265,7 @@ func (s *Stream) Write(p []byte) (n int, err error) {
func (s *Stream) WriteSCTP(p []byte, ppi PayloadProtocolIdentifier) (int, error) {
maxMessageSize := s.association.MaxMessageSize()
if len(p) > int(maxMessageSize) {
return 0, fmt.Errorf("%w: %v", ErrOutboundPacketTooLarge, math.MaxUint16)
return 0, fmt.Errorf("%w: %v", ErrOutboundPacketTooLarge, maxMessageSize)
}

if s.State() != StreamStateOpen {
Expand Down

0 comments on commit 6c3ef3a

Please sign in to comment.