From 2600de314f7a927dd0a3e3a1dfc70885912e0635 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()