From 29c46e2ef36d7f273fb4817a32aa0c9fc878b4be Mon Sep 17 00:00:00 2001 From: cnderrauber Date: Tue, 10 Dec 2024 10:48:01 +0800 Subject: [PATCH] Return 0 written bytes on write error Return 0 written bytes on write error --- stream.go | 1 + 1 file changed, 1 insertion(+) diff --git a/stream.go b/stream.go index ed06d69..3be1291 100644 --- a/stream.go +++ b/stream.go @@ -291,6 +291,7 @@ func (s *Stream) WriteSCTP(p []byte, ppi PayloadProtocolIdentifier) (int, error) s.sequenceNumber-- } s.lock.Unlock() + n = 0 } if s.association.isBlockWrite() { s.writeLock.Unlock()