From 6c3ef3ab811b3e475d57597bc5a5ebc3460acf4b Mon Sep 17 00:00:00 2001 From: Rob Deutsch Date: Wed, 13 Mar 2024 12:33:24 +1100 Subject: [PATCH] Update WriteSCTP outbound packet too large error --- stream.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/stream.go b/stream.go index eeb585e7..47e06f35 100644 --- a/stream.go +++ b/stream.go @@ -7,7 +7,6 @@ import ( "errors" "fmt" "io" - "math" "os" "sync" "sync/atomic" @@ -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 {