forked from quic-go/quic-go
return the putStream error in the streamsMap
This commit is contained in:
@@ -128,15 +128,13 @@ func (m *streamsMap) openRemoteStream(id protocol.StreamID) (streamI, error) {
|
|||||||
m.highestStreamOpenedByPeer = id
|
m.highestStreamOpenedByPeer = id
|
||||||
}
|
}
|
||||||
s := m.newStream(id)
|
s := m.newStream(id)
|
||||||
m.putStream(s)
|
return s, m.putStream(s)
|
||||||
return s, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *streamsMap) openStreamImpl() (streamI, error) {
|
func (m *streamsMap) openStreamImpl() (streamI, error) {
|
||||||
s := m.newStream(m.nextStreamToOpen)
|
s := m.newStream(m.nextStreamToOpen)
|
||||||
m.putStream(s)
|
|
||||||
m.nextStreamToOpen = m.nextStreamID(m.nextStreamToOpen)
|
m.nextStreamToOpen = m.nextStreamID(m.nextStreamToOpen)
|
||||||
return s, nil
|
return s, m.putStream(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
// OpenStream opens the next available stream
|
// OpenStream opens the next available stream
|
||||||
|
|||||||
@@ -138,8 +138,7 @@ func (m *streamsMapLegacy) openRemoteStream(id protocol.StreamID) (streamI, erro
|
|||||||
}
|
}
|
||||||
|
|
||||||
s := m.newStream(id)
|
s := m.newStream(id)
|
||||||
m.putStream(s)
|
return s, m.putStream(s)
|
||||||
return s, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *streamsMapLegacy) openStreamImpl() (streamI, error) {
|
func (m *streamsMapLegacy) openStreamImpl() (streamI, error) {
|
||||||
@@ -149,9 +148,8 @@ func (m *streamsMapLegacy) openStreamImpl() (streamI, error) {
|
|||||||
|
|
||||||
m.numOutgoingStreams++
|
m.numOutgoingStreams++
|
||||||
s := m.newStream(m.nextStreamToOpen)
|
s := m.newStream(m.nextStreamToOpen)
|
||||||
m.putStream(s)
|
|
||||||
m.nextStreamToOpen += 2
|
m.nextStreamToOpen += 2
|
||||||
return s, nil
|
return s, m.putStream(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
// OpenStream opens the next available stream
|
// OpenStream opens the next available stream
|
||||||
|
|||||||
Reference in New Issue
Block a user