Skip to content

Commit

Permalink
Reject WriteSCTP when stream close
Browse files Browse the repository at this point in the history
  • Loading branch information
jerry-tao committed Oct 13, 2022
1 parent 1bd9920 commit bc97f42
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,10 @@ func (s *Stream) WriteSCTP(p []byte, ppi PayloadProtocolIdentifier) (int, error)
return 0, fmt.Errorf("%w: %v", errOutboundPacketTooLarge, math.MaxUint16)
}

if s.State() != StreamStateOpen {
return 0, errStreamClosed
}

chunks := s.packetize(p, ppi)
n := len(p)
err := s.association.sendPayloadData(chunks)
Expand Down

0 comments on commit bc97f42

Please sign in to comment.