create internal interfaces for send and receive streams

And use those for handling frames.
This commit is contained in:
Marten Seemann 2017-12-26 10:44:56 +07:00
parent 7a3209b3a4
commit e802491a8f
13 changed files with 391 additions and 58 deletions

View file

@ -12,6 +12,15 @@ import (
"github.com/lucas-clemente/quic-go/internal/wire"
)
type receiveStreamI interface {
ReceiveStream
handleStreamFrame(*wire.StreamFrame) error
handleRstStreamFrame(*wire.RstStreamFrame) error
closeForShutdown(error)
getWindowUpdate() protocol.ByteCount
}
type receiveStream struct {
mutex sync.Mutex
@ -40,6 +49,7 @@ type receiveStream struct {
}
var _ ReceiveStream = &receiveStream{}
var _ receiveStreamI = &receiveStream{}
func newReceiveStream(
streamID protocol.StreamID,