Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion spdy/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,13 @@ func (s *Transport) getStream(referenceID uint64) *stream {

}

func (s *Transport) removeStream(stream *stream) {
s.streamC.L.Lock()
delete(s.streams, stream.referenceID)
s.streamC.L.Unlock()
s.streamC.Broadcast()
}

// Close closes the underlying stream provider
func (s *Transport) Close() error {
return s.provider.Close()
Expand Down Expand Up @@ -240,7 +247,7 @@ func (s *sender) Send(message interface{}) error {
// Close closes the underlying stream, causing any subsequent
// sends to throw an error and receives to return EOF.
func (s *sender) Close() error {
return s.stream.stream.Close()
return s.stream.Close()
}

// Receive receives a message sent across the channel from
Expand Down Expand Up @@ -304,5 +311,6 @@ func (s *stream) Write(b []byte) (int, error) {
}

func (s *stream) Close() error {
defer s.session.removeStream(s)
return s.stream.Close()
}