forked from quic-go/quic-go
close all streams when closing the IETF QUIC streams map
This commit is contained in:
@@ -4,14 +4,11 @@ import (
|
||||
"fmt"
|
||||
"sync"
|
||||
|
||||
"github.com/cheekybits/genny/generic"
|
||||
"github.com/lucas-clemente/quic-go/internal/protocol"
|
||||
"github.com/lucas-clemente/quic-go/internal/wire"
|
||||
"github.com/lucas-clemente/quic-go/qerr"
|
||||
)
|
||||
|
||||
type item generic.Type
|
||||
|
||||
//go:generate genny -in $GOFILE -out streams_map_outgoing_bidi.go gen "item=streamI Item=BidiStream"
|
||||
//go:generate genny -in $GOFILE -out streams_map_outgoing_uni.go gen "item=sendStreamI Item=UniStream"
|
||||
type outgoingItemsMap struct {
|
||||
@@ -119,6 +116,9 @@ func (m *outgoingItemsMap) SetMaxStream(id protocol.StreamID) {
|
||||
func (m *outgoingItemsMap) CloseWithError(err error) {
|
||||
m.mutex.Lock()
|
||||
m.closeErr = err
|
||||
for _, str := range m.streams {
|
||||
str.closeForShutdown(err)
|
||||
}
|
||||
m.cond.Broadcast()
|
||||
m.mutex.Unlock()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user