don't enqueue send stream for sending on duplicate Close calls (#4815)

This commit is contained in:
Marten Seemann
2024-12-28 16:43:16 +08:00
committed by GitHub
parent 810ef27db5
commit 72a934f375
2 changed files with 1 additions and 3 deletions

View File

@@ -398,7 +398,7 @@ func (s *sendStream) isNewlyCompleted() bool {
func (s *sendStream) Close() error {
s.mutex.Lock()
if s.closeForShutdownErr != nil {
if s.closeForShutdownErr != nil || s.finishedWriting {
s.mutex.Unlock()
return nil
}